Describe the bug
There are two ways of representing a 'Nullable' field in OpenAPI.
The first is to mark the field as not required and the second is to set the type to be union-ed with Null.
The second method has the implication that the key must be sent with an explicit Null value whereas the first suggests.
When a spec uses AnyOf with string and null, the parser crashes. As null is a unknown data type.
To Reproduce
Parse the following spec and see it throw an exception of openapi_parser.errors.ParserError: Invalid schema type 'null'
Describe the bug There are two ways of representing a 'Nullable' field in OpenAPI. The first is to mark the field as not required and the second is to set the type to be union-ed with Null. The second method has the implication that the key must be sent with an explicit Null value whereas the first suggests.
When a spec uses
AnyOf
withstring
andnull
, the parser crashes. Asnull
is a unknown data type.To Reproduce Parse the following spec and see it throw an exception of
openapi_parser.errors.ParserError: Invalid schema type 'null'
Expected behavior Not to crash.
I've created #64 to fix this issue
System details (please complete the following information):
Additional context Add any other context about the problem here.