You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't want to create an issue since this feature is not officially supported in the OpenAPI spec, but I think we can trigger a discussion on this topic: How to support named enums ?
Currently, none of the 2 solutions proposed below generate a proper typescript enum.
Few solutions has been proposed:
Support custom x- property
Adding a custom "x-..."property in the OpenAPI schema.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
I don't want to create an issue since this feature is not officially supported in the OpenAPI spec, but I think we can trigger a discussion on this topic:
How to support named enums ?
Currently, none of the 2 solutions proposed below generate a proper typescript enum.
Few solutions has been proposed:
Support custom x- property
Adding a custom "x-..."property in the OpenAPI schema.
Example:
Few typescript codegen tool support this:
Use "oneOf" from OpenAPI 3.1
This is the official OpenAPI response on this.
use oneOf combined with "title" and "const":
I'm not a big fan on this because it's not supported by OpenAPI codegen tools.
===
Do you have any input on this @astahmer ?
Btw, I would be happy to propose a PR to support the first solution
Beta Was this translation helpful? Give feedback.
All reactions