Set x-nullable based on allow_null (#217)
Many fields may be set a nullable in an API. While not covered explicitly by Swagger 2, this information is usually indicated as a [vendor extension](https://swagger.io/docs/specification/2-0/swagger-extensions/) using the x-nullable field.
This commit is contained in:
committed by
Cristi Vîjdea
parent
c510de13d7
commit
d41f0c5ac4
@@ -33,7 +33,12 @@ class ArticleSerializer(serializers.ModelSerializer):
|
||||
|
||||
|
||||
class ImageUploadSerializer(serializers.Serializer):
|
||||
what_am_i_doing = serializers.RegexField(regex=r"^69$", help_text="test", default="69")
|
||||
what_am_i_doing = serializers.RegexField(
|
||||
regex=r"^69$",
|
||||
help_text="test",
|
||||
default="69",
|
||||
allow_null=True
|
||||
)
|
||||
image_styles = serializers.ListSerializer(
|
||||
child=serializers.ChoiceField(choices=['wide', 'tall', 'thumb', 'social']),
|
||||
help_text="Parameter with Items"
|
||||
|
||||
Reference in New Issue
Block a user