-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Missing support for "const" keyword #658
Comments
Or I guess more correctly:
|
@larsks |
The generated model file should use Literal Instead of const. |
@koxudaxi Hi! Are there any updates on adding this feature to datamodel-codegen? |
Is there any progress for the implementation of the "const" keyword? |
@larsks @bharathimohan11 @Sergei-Volkov @sjohnen |
Describe the bug
OpenAPI 3 references JSONSchema 2019-09 (since OAI/OpenAPI-Specification#1977), which includes support for the
const
keyword. Theconst
keyword is for defining constant value properties in schemas.To Reproduce
Example schema (this is part of an OpenAPI specification):
Used commandline:
Expected behavior
I expected the generated model to look something like this:
But what the cli currently generates is:
Version:
The text was updated successfully, but these errors were encountered: