mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 01:26:53 +03:00
ListField
mapping should map all options for the child
Previously it was only mapping the `type` and `format`, even though for some field types (like a `MultipleChoiceField`) we map more than just these. And for some fields (like a `ChoiceField`) we do not map the `type` at all.
This commit is contained in:
parent
b1048984a7
commit
98c8af5291
|
@ -259,13 +259,7 @@ class AutoSchema(ViewInspector):
|
|||
'items': {},
|
||||
}
|
||||
if not isinstance(field.child, _UnvalidatedField):
|
||||
map_field = self._map_field(field.child)
|
||||
items = {
|
||||
"type": map_field.get('type')
|
||||
}
|
||||
if 'format' in map_field:
|
||||
items['format'] = map_field.get('format')
|
||||
mapping['items'] = items
|
||||
mapping['items'] = self._map_field(field.child)
|
||||
return mapping
|
||||
|
||||
# DateField and DateTimeField type is string
|
||||
|
|
Loading…
Reference in New Issue
Block a user