Skip to content

Oddity in .components.schemas.authorization.properties.user #366

Open
@masklinn

Description

@masklinn

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"
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions