Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
masklinn opened this issue May 31, 2021 · 0 comments
Open

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

masklinn opened this issue May 31, 2021 · 0 comments

Comments

@masklinn
Copy link

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"
    }
@bruce bruce added the P4 label Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants