Skip to content

Commit 98c8af5

Browse files
kevin-browncarltongibson
authored andcommitted
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.
1 parent b104898 commit 98c8af5

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

rest_framework/schemas/openapi.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,7 @@ def _map_field(self, field):
259259
'items': {},
260260
}
261261
if not isinstance(field.child, _UnvalidatedField):
262-
map_field = self._map_field(field.child)
263-
items = {
264-
"type": map_field.get('type')
265-
}
266-
if 'format' in map_field:
267-
items['format'] = map_field.get('format')
268-
mapping['items'] = items
262+
mapping['items'] = self._map_field(field.child)
269263
return mapping
270264

271265
# DateField and DateTimeField type is string

0 commit comments

Comments
 (0)