File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,11 +82,11 @@ class MyModel(BaseModel):
8282
8383``` python
8484class MyModelSerializer :
85- name = CharField(allow_null = False , required = True )
85+ name = CharField(allow_null = False , required = True , allow_blank = True )
8686 addresses = ListField(
8787 allow_empty = True ,
8888 allow_null = False ,
89- child = CharField(allow_null = False ),
89+ child = CharField(allow_null = False , allow_blank = True ),
9090 required = True ,
9191 )
9292```
@@ -370,7 +370,7 @@ Additional field properties are mapped as follows (`pydantic` -> `DRF`):
370370
371371- ` description ` -> ` help_text `
372372- ` title ` -> ` label `
373- - ` StringConstraints ` -> ` min_length ` and ` max_length `
373+ - ` StringConstraints ` -> ` min_length ` and ` max_length ` and ` allow_blank `
374374- ` pattern ` -> Uses the specialized ` RegexField ` serializer field
375375- ` max_digits ` and ` decimal_places ` are carried over
376376 (used for ` Decimal ` types, with the current decimal context precision)
You can’t perform that action at this time.
0 commit comments