You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When we generate the code in Kotlin language with a Bigdecimal default value, the code doesn't compile.
We got a Type mismatch error : inferred type is Double but BigDecimal? was expected..
The kotlin-spring generator is used for my project. Find the documentation below : https://openapi-generator.tech/docs/generators/kotlin-spring/
openapi-generator version
I'm using the 6.2.1 version of openapi-generator.
OpenAPI declaration file content or url
Please find below a sample of the affected class from my yaml file :
LoanType:
type: objectproperties:
projectTotalAmount:
type: numberdescription: | #### Total amount of the projectdefault: -9999999999.99downpaymentAmount:
type: numberdescription: | #### Downpayment amountdefault: -9999999999.99
Generation Details
The expected generated code for the class fields should be :
data classLoanType(
varprojectTotalAmount: java.math.BigDecimal?= BigDecimal(-9999999999.99)
vardownpaymentAmount: java.math.BigDecimal?= BigDecimal(-9999999999.99)
)
Instead of the actual result that doesn't compile :
data classLoanType(
varprojectTotalAmount: java.math.BigDecimal?= -9999999999.99vardownpaymentAmount: java.math.BigDecimal?= -9999999999.99
)
Steps to reproduce
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered:
@wing328 Sorry, i had some days off. It would be very appreciated if you can show me some starting points.
Please let me know how you want us to proceed.
Hello! We're also facing the same issue, it was fixed for kotlin config, but not for kotlin-spring: #10866, fixed in #12213, would be awesome to have it fixed for spring config also. @wing328 if you can give some tips or maybe if it's similar to the kotlin fix we could make the contribution.
Bug Report Checklist
Description
When we generate the code in Kotlin language with a Bigdecimal default value, the code doesn't compile.
We got a Type mismatch error : inferred type is Double but BigDecimal? was expected..
The kotlin-spring generator is used for my project. Find the documentation below :
https://openapi-generator.tech/docs/generators/kotlin-spring/
openapi-generator version
I'm using the 6.2.1 version of openapi-generator.
OpenAPI declaration file content or url
Please find below a sample of the affected class from my yaml file :
Generation Details
The expected generated code for the class fields should be :
Instead of the actual result that doesn't compile :
Steps to reproduce
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: