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

OpenAPI 3.1 - emit annotated enums #5721

Open
chrisradek opened this issue Jan 23, 2025 · 0 comments
Open

OpenAPI 3.1 - emit annotated enums #5721

chrisradek opened this issue Jan 23, 2025 · 0 comments

Comments

@chrisradek
Copy link
Member

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).

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

1 participant