-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[BUG] Default values, min, max, etc. are missing from generated Go models for object properties #4579
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
So I take it that this is just not part of the openapi-generator functionality? That openapi-generator just ignores default, min, and max values? If so, I guess I need to look elsewhere. Can someone comment please? Thanks. |
you can extend the mustach-template with your missing values. |
When a default value is set for an object property, ensure it is set into the struct before decoding the JSON body. Fix OpenAPITools#4579
When a default value is set for an object property, ensure it is set into the struct before decoding the JSON body. Fix OpenAPITools#4579
When a default value is set for an object property, ensure it is set into the struct before decoding the JSON body. Fix OpenAPITools#4579
When a default value is set for an object property, ensure it is set into the struct before decoding the JSON body. Fix OpenAPITools#4579
When a default value is set for an object property, ensure it is set into the struct before decoding the JSON body. Fix OpenAPITools#4579
When a default value is set for an object property, ensure it is set into the struct before decoding the JSON body. Fix OpenAPITools#4579
When a default value is set for an object property, ensure it is set into the struct before decoding the JSON body. Fix OpenAPITools#4579
Bug Report Checklist
Description
I defined an API with an object property that has default values, minimum, maximum, etc. The generated Go code lacks this information completely.
openapi-generator version
4.2.1
OpenAPI declaration file content or url
Command line used for generation
java -jar openapi-generator-cli.jar generate -i example.yaml -o example-gen -g go
Steps to reproduce
Execute the above command. Search the generated code for default values, minimum, maximum, etc. In example-gen/model_whatever_config.go, find:
But no mention of the default values, minimum, maximum, etc. for any property.
Related issues/PRs
Suggest a fix
Not sure if this is a fix or a feature request. I don't understand why this information is missing from the generated Go code.
The text was updated successfully, but these errors were encountered: