#12149 remove spectacular choice mapping fixup internal one

This commit is contained in:
Arthur 2023-04-17 14:16:36 -07:00 committed by Jeremy Stretch
parent 13625325f5
commit 31c909c368
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ from drf_spectacular.plumbing import (
ComponentRegistry,
ResolvedComponent,
build_basic_type,
build_choice_field,
build_media_type_object,
build_object_type,
is_serializer,
@ -38,7 +39,7 @@ class ChoiceFieldFix(OpenApiSerializerFieldExtension):
def map_serializer_field(self, auto_schema, direction):
if direction == 'request':
return build_basic_type(OpenApiTypes.STR)
return build_choice_field(self.target)
elif direction == "response":
return build_object_type(

View File

@ -589,6 +589,7 @@ SPECTACULAR_SETTINGS = {
'SWAGGER_UI_DIST': 'SIDECAR',
'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
'REDOC_DIST': 'SIDECAR',
'POSTPROCESSING_HOOKS': [],
}
#