-
-
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][Kotlin] Wrong default value is generated if the field type is BigDecimal #10866
Comments
I see the same problem in Java. I was using
And the generated code tried to do
which fails at runtime with
|
@alitams: I have provided a PR to fix this bug in #12213. @jaycarlton: I am unable to reproduce your results in the Java client. Could you please provide the generator settings that you use when the bug appears? |
@sjoblomj We actually use swagger-codegen, so unless the bug is before the fork (assuming I have the history right), it wouldn't necessarily show up here. Sorry for the confusion. |
Bug Report Checklist
Description
If one of the type's mapping value is BigDecimal, and sets a default value, then a simple Int is given to the value.
Generated:
Expected:
(or BigDecimal(0))
openapi-generator version
5.3.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Generate the code below, and check the result.
Related issues/PRs
Suggest a fix
The BigDecimal should handled to generate the schema well.
For example:
The text was updated successfully, but these errors were encountered: