From 98c8af5291ac366b3030c4091284091ca63943ac Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Thu, 9 Jan 2020 20:43:44 -0500 Subject: [PATCH] `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. --- rest_framework/schemas/openapi.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 1df132ce3..cb5ea95a3 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -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