Open
Description
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 specifiesnullable
as:A
true
value adds"null"
to the allowed type specified by thetype
keyword, only iftype
is explicitly defined within the same Schema
Object.
(emphasis mine). Since the schema object associated with theuser
property does not have atype
, thenullable
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" }