Closed erezarnon closed 7 months ago
Hello, @erezarnon.
The value null
is not a valid type. This is per the spec at https://spec.openapis.org/oas/v3.0.3#data-types.
In the first paragraph under section 4.4 Data Types, you'll see that it says
null is not supported as a type (see nullable for an alternative solution)
The OpenAPI Enforcer does support nullable for OpenAPI 3.0.x.
I hope that solves your problem, but if not please reach out again and I'll see if I can help out.
Yes. I had to use allOf
instead of just the $ref
for nullable
to work, which is weird, but it worked
I thought that maybe you'd put nullable
inside of the X definition, but maybe that wasn't an option for you. Either way, I'm glad you were able to resolve it.
Define a schema with a field that can either be a ref or null.
Receive the following error
Value must be one of: array, boolean, integer, number, object, string. Received: "null"