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?
馃憤 Thanks for opening this issue!
馃彿 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
I'm having the same issue using 4.2.3.
worked around this by using the following type mapping:
<typeMappings>
<typeMapping>number=java.lang.Double</typeMapping>
</typeMappings>
The work around suggested by @conet works well. In my case, I added it to the pom.xml file as shown below.
<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.2.3</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec>
<generatorName>spring</generatorName>
<apiPackage>org.ogc.api</apiPackage>
<modelPackage>org.ogc.model</modelPackage>
<supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>
<configOptions>
<delegatePattern>true</delegatePattern>
</configOptions>
<typeMappings>
<typeMapping>number=java.lang.Double</typeMapping>
</typeMappings>
</configuration>
</execution>
</executions>
</plugin>
Closed via #8018
Please pull the latest master to give it a try.
Thanks for the PR by @bgong-mdsol
Most helpful comment
Closed via #8018
Please pull the latest master to give it a try.
Thanks for the PR by @bgong-mdsol