You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When adding a nullableenum Schema, the operation will fail unless null is directly provided in the enum list. This is because nullable is not processed before the schema is validated and not having null in the values causes an error.
Schema Example:
The following causes the Exception, whereas including null will satisfy the schema.
("None is not one of ['asc', 'desc']", 'enum', deque([]), None, [], ['asc', 'desc'], None, {'type': 'string', 'nullable': True, 'default': None, 'enum': ['asc', 'desc']}, deque(['enum']), None)
To Reproduce
Steps to reproduce the behavior:
Create an endpoint with a nullablestring parameter.
Do not include null in the enum values
Attempt to parse the spec
Expected behavior
When adding a nullable field - the property should have null automatically added to the enum list - with the default being null if not supplied while allowing a set value.
System details (please complete the following information):
OS: [Ubuntu]
OpenAPI / Swagger version [OpenAPI 3.0.1]
Python version [3.10.12]
The text was updated successfully, but these errors were encountered:
Describe the bug
When adding a
nullable
enum
Schema, the operation will fail unlessnull
is directly provided in theenum
list. This is becausenullable
is not processed before the schema is validated and not havingnull
in the values causes an error.Schema Example:
The following causes the Exception, whereas including
null
will satisfy the schema.Corrected:
Exception:
To Reproduce
Steps to reproduce the behavior:
nullable
string
parameter.null
in the enum valuesExpected behavior
When adding a
nullable
field - the property should havenull
automatically added to the enum list - with the default beingnull
if not supplied while allowing a set value.System details (please complete the following information):
The text was updated successfully, but these errors were encountered: