Merge pull request #4492 from kobayashi/4361-type-connection_status

Fix #4361 Set correct type of connection_status in swagger schema
This commit is contained in:
Jeremy Stretch 2020-04-15 09:45:39 -04:00 committed by GitHub
commit 5aadfff1de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@
### Bug Fixes
* [#4361](https://github.com/netbox-community/netbox/issues/4361) - Fix Type of `connection_state` in swagger schema.
* [#4489](https://github.com/netbox-community/netbox/issues/4489) - Fix display of parent/child role on device type view
* [#4496](https://github.com/netbox-community/netbox/issues/4496) - Fix exception when validating certain models via REST API

View File

@ -92,7 +92,7 @@ class CustomChoiceFieldInspector(FieldInspector):
value_schema = openapi.Schema(type=schema_type, enum=choice_value)
value_schema['x-nullable'] = True
if isinstance(choice_value[0], int):
if all(type(x) == int for x in [c for c in choice_value if c is not None]):
# Change value_schema for IPAddressFamilyChoices, RackWidthChoices
value_schema = openapi.Schema(type=openapi.TYPE_INTEGER, enum=choice_value)