OpenAPITools / OpenAPITools/openapi-generator
[BUG] [java] incompatible types: double cannot be converted to java.math.BigDecimal
Open
Nobody has claimed this yet.
Client: Java
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
hello i'm using version 4.2.1
my json is in the following format

and the generated code looks like this

this was an error at compile time because you can parse it year.
'incompatible types: double cannot be converted to java.math.BigDecimal'
Is there any way around this problem?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the compile-time error with the JSON and generated Java shown in the issue, using version 4.2.1. Trace which generator path produces the incompatible assignment; done means the generated Java compiles without the double-to-BigDecimal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100