-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Add support for const
keyword
#1834
Comments
I don't see a spec including
being compatible with the OpenAPI spec, where |
Ah, sorry I've actually overloaded
The issue still applies here independent of the property name. |
That would still be an extension to the OpenAPI spec, or am i misunderstanding your proposal? |
The OpenAPI spec includes the
The JSON Schema Validation spec above defines the Some other libraries already have support for |
I see, i just looked at the currently supported v3.0, not at v3.1, sorry. |
Ah, I see! So only v3.0 is currently supported here. Any opposition to starting v3.1 support with this change? Adding |
I'm by no means opposed, but i'm also not the maintainer of this library. |
This would be great, in fact this is making this generator not usable with the SpatioTemporal Asset Catalogs standard, which uses a |
I have a usecase where it would be helpful to support constant values via the
const
keyword.Say we have an api spec containing some models like:
In typescript, this should map to something like:
This way, we can narrow the type in a useful way:
However,
openapi-typescript-codegen
mapsconst
values toany
types, so the type information is lost.The text was updated successfully, but these errors were encountered: