-
Notifications
You must be signed in to change notification settings - Fork 291
Closed
Description
user is defined as a non-required nullable allOf a ref to /components/schemas/simple-user, which is itself nullable.
- the property-level
nullableseems incorrect as OpenAPI specifiesnullableas:A
truevalue adds"null"to the allowed type specified by thetype
keyword, only iftypeis explicitly defined within the same Schema
Object.
(emphasis mine). Since the schema object associated with theuserproperty does not have atype, thenullableannotation seems to do nothing: the nullability of the value is controlled by/components/schemas/simple-user. - as a result, the intermediate
allOfseems 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" }