Skip to content

Commit

Permalink
#12149 remove spectacular choice mapping fixup internal one
Browse files Browse the repository at this point in the history
  • Loading branch information
arthanson committed Apr 17, 2023
1 parent 8b040ff commit f146515
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion netbox/core/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ComponentRegistry,
ResolvedComponent,
build_basic_type,
build_choice_field,
build_media_type_object,
build_object_type,
is_serializer,
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions netbox/netbox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ def _setting(name, default=None):
'SWAGGER_UI_DIST': 'SIDECAR',
'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
'REDOC_DIST': 'SIDECAR',
'POSTPROCESSING_HOOKS': [],
}

#
Expand Down

0 comments on commit f146515

Please sign in to comment.