Skip to content

[Schema Inaccuracy] Repository Advisory's author and publisher fields #2534

Open
@aj-foster

Description

@aj-foster

Schema Inaccuracy

Currently, the #/components/schemas/repository-advisory schema has two fields with interesting types:

        author:
          readOnly: true
          description: The author of the advisory.
          allOf:
          - "$ref": "#/components/schemas/simple-user"
          type:
          - 'null'
        publisher:
          readOnly: true
          description: The publisher of the advisory.
          allOf:
          - "$ref": "#/components/schemas/simple-user"
          type:
          - 'null'

This appears to be somewhat contradictory, though it's always possible I'm misunderstanding the intent and the spec. The impact is that I'm currently unable to generate client code using a custom code generator (which, of course, might be wrong).

Expected

I believe the contents of the allOf property should be part of type, creating a nullable union:

        author:
          readOnly: true
          description: The author of the advisory.
          type:
          - "$ref": "#/components/schemas/simple-user"
          - 'null'
        publisher:
          readOnly: true
          description: The publisher of the advisory.
          type:
          - "$ref": "#/components/schemas/simple-user"
          - 'null'

Reproduction Steps

This issue arose while generating code from the description, so no API endpoint calls are involved. The code generator is language-specific, so it's unlikely to be useful during reproduction.

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