Skip to content

OpenAPI 3.1 - emit annotated enums #5721

Open
@chrisradek

Description

@chrisradek

Moving from discussion: #5378

The Open API 3.1 spec suggests a way to support annotated enums:
https://spec.openapis.org/oas/v3.1.1.html#annotated-enumerations

Implementations MAY support recognizing a oneOf or anyOf where each subschema in the keyword’s array consists of a const keyword and annotations such as title or description as an enumerated type with additional information. The exact behavior of this pattern beyond what is required by JSON Schema is implementation-defined.

We should consider supporting this in the Open API 3.1 emitter. One question is whether to do this by default, or make it an option since some tooling may not recognize this as an enum (potentially treating it as a union instead).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions