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:
Kevin Brown 2020-01-09 20:43:44 -05:00
parent 2269a90dac
commit 513f7ca390

View File

@ -268,13 +268,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