We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
When generating model with fields not required nullable attribute is ignored
5.3.0
components: schemas: Cat: type: object xml: name: cat properties: id: type: integer format: int64 nullable: false name: type: boolean nullable: true
Generate this class. Expected result:
data class Cat ( @SerializedName("id") val id: kotlin.Long, @SerializedName("name") val name: kotlin.Boolean? = null )
actual:
data class Cat ( @SerializedName("id") val id: kotlin.Long? = null, @SerializedName("name") val name: kotlin.Boolean? = null )
#4530
Copy the solution from /data_class_req_var.mustache to data_class_opt_var.mustache
/data_class_req_var.mustache
data_class_opt_var.mustache
{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Bug Report Checklist
Description
When generating model with fields not required nullable attribute is ignored
openapi-generator version
5.3.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Generate this class. Expected result:
actual:
Related issues/PRs
#4530
Suggest a fix
Copy the solution from
/data_class_req_var.mustache
todata_class_opt_var.mustache
The text was updated successfully, but these errors were encountered: