user is defined as a non-required nullable allOf a ref to /components/schemas/simple-user, which is itself nullable.
- the property-level
nullable seems incorrect as OpenAPI specifies nullable as:
A true value adds "null" to the allowed type specified by the type
keyword, only if type is explicitly defined within the same Schema
Object.
(emphasis mine). Since the schema object associated with the user property does not have a type, the nullable annotation seems to do nothing: the nullability of the value is controlled by /components/schemas/simple-user.
- as a result, the intermediate
allOf seems completely unnecessary: per OpenAPI,
Alternatively, any time a Schema Object can be used, a Reference
Object can be used in its place. This allows referencing
definitions instead of defining them inline.
so it should be possible to just have
"user": {
"$ref": "#/components/schemas/simple-user"
}
useris defined as a non-required nullableallOfarefto/components/schemas/simple-user, which is itselfnullable.nullableseems incorrect as OpenAPI specifiesnullableas:allOfseems completely unnecessary: per OpenAPI,