Closed le-jhe closed 5 years ago
Thank you a lot for this Issue.
Initial issue #49 was fixed by @Zomzog in PR #75 and is available with 3.1.0-SNAPSHOT
. In the 3.0.x
version this was not supported at all.
You ave spotted the right place in code and "type" : "number"
should be supported.
Actually, looking at the initial issue gave me an idea to test. What I can say now is that, with 3.0.3, my problem is fixed if I use "type" : "integer"
instead of "type" : "number"
So thank's, my problem is worked around even in 3.0.3. I will test the fix when 3.1.x becomes available.
@le-jhe I am glad your problem is solved, but I still think that we should support number
Description
Given that a numerical enum is in my custom input types, openapi-generator "decides" to use BigDecimal for mapping the "type" : "number" (maybe because of something in my pom). The problem is that the java source code generated for the enum is not correct
Correct code should be something like
openapi-generator version
OpenAPI declaration file content or url
With the following type definition in my input .json file:
Command line used for generation
Steps to reproduce
mvn package
Suggest a fix/enhancement
Check AbstractJavaCodegen.java:1045 ( toEnumValue(...) )in the list of numerical types, BigDecimal is not there, thus the processor goes to default and just wraps escaped values with string