We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
after updating to version 7.12.0 the current configuration produces enums with unexpected 'underscore'
7.12.0
<configuration> <inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec> <generatorName>java</generatorName> <skipValidateSpec>true</skipValidateSpec> <strictSpec>true</strictSpec> <generateApis>false</generateApis> <generateSupportingFiles>false</generateSupportingFiles> <generateModelTests>false</generateModelTests> <apiPackage>com.api</apiPackage> <modelPackage>com.api</modelPackage> <typeMappings> <typeMapping>Double=java.math.BigDecimal</typeMapping> <typeMapping>Boolean=boolean</typeMapping> <typeMapping>Date=String</typeMapping> <typeMapping>UUID=String</typeMapping> </typeMappings> <importMappings> <importMapping>Double=java.math.BigDecimal</importMapping> <importMapping>Boolean=boolean</importMapping> <importMapping>Date=String</importMapping> <importMapping>UUID=String</importMapping> </importMappings> <configOptions> <useJakartaEe>true</useJakartaEe> <dateLibrary>custom</dateLibrary> <library>resteasy</library> <sourceFolder>src/gen/java/main</sourceFolder> <openApiNullable>false</openApiNullable> <additionalModelTypeAnnotations>@lombok.Builder @lombok.AllArgsConstructor</additionalModelTypeAnnotations> <performBeanValidation>true</performBeanValidation> <useBeanValidation>true</useBeanValidation> <serializationLibrary>jackson</serializationLibrary> </configOptions> </configuration>
I tried to play around adding :
<enumPropertyNaming>original</enumPropertyNaming>
but the generator throws exception as the only types allowed are MACRO_CASE and legacy
even when I try to add :
removeEnumValuePrefix=true
or any similar/related enum config, nothing happens.
I looked into the source code but I couldn't fine a way to over come this problem and keep the previous behaviour.
probably there is something I miss with the configuration and that leads to this enum generation issue.
below the generated enum after the update
C2_C("C2C"), CORE("CORE");
before the update with version 7.5.0
B2B("C2C"), CORE("CORE");
below the example of the openapi definition
"Type": { "type": "string", "description": "Type [C2C, CORE]", "enum": [ "C2C", "CORE" ] }
we use the openapi-generator-maven-plugin
openapi-generator-maven-plugin
version : 7.12.0
just run the maven command with the two versions and you will be able to replicate the issue
The text was updated successfully, but these errors were encountered:
did you try setting the option enumPropertyNaming to legacy?
enumPropertyNaming
legacy
ref: https://openapi-generator.tech/docs/generators/java/
Sorry, something went wrong.
thank you for the reference. that solved the issue.
No branches or pull requests
Bug Report Checklist
Description
after updating to version
7.12.0
the current configuration produces enums with unexpected 'underscore'I tried to play around adding :
<enumPropertyNaming>original</enumPropertyNaming>
but the generator throws exception as the only types allowed are MACRO_CASE and legacy
even when I try to add :
removeEnumValuePrefix=true
or any similar/related enum config, nothing happens.
I looked into the source code but I couldn't fine a way to over come this problem and keep the previous behaviour.
probably there is something I miss with the configuration and that leads to this enum generation issue.
below the generated enum after the update
before the update with version 7.5.0
openapi-generator version
7.12.0
OpenAPI declaration file content or url
below the example of the openapi definition
Generation Details
we use the
openapi-generator-maven-plugin
version :
7.12.0
Steps to reproduce
just run the maven command with the two versions and you will be able to replicate the issue
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: