mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 03:27:21 -06:00
#12149 remove spectacular choice mapping fixup internal one
This commit is contained in:
parent
13625325f5
commit
31c909c368
@ -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(
|
||||
|
@ -589,6 +589,7 @@ SPECTACULAR_SETTINGS = {
|
||||
'SWAGGER_UI_DIST': 'SIDECAR',
|
||||
'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
|
||||
'REDOC_DIST': 'SIDECAR',
|
||||
'POSTPROCESSING_HOOKS': [],
|
||||
}
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user