-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
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
[BUG] Incorrect ENUM generation #19066
Comments
Hello, I suspect this commit to be the root cause : bfa26ea#diff-a98cba8ecadaf5a662edc508aa5857972339552ec6bd6e4216680c7c6070e643 which is linked to this request #4837 Sadly it seems that we can't change this behavior (some generator have the option to choose the 'enumPropertyNaming' - |
please refer to #18594 (comment) on how to fallback |
Is there an option to just use the enum as is? Without any futher modifications? |
…7.0 (#873) * Bump org.openapitools:openapi-generator-maven-plugin from 7.6.0 to 7.7.0 Bumps org.openapitools:openapi-generator-maven-plugin from 7.6.0 to 7.7.0. --- updated-dependencies: - dependency-name: org.openapitools:openapi-generator-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Force the enum variable names to be uppercase without underscores see: - OpenAPITools/openapi-generator#19086 - OpenAPITools/openapi-generator#19066 and cause: - OpenAPITools/openapi-generator#4837 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mark Prins <1165786+mprins@users.noreply.github.com>
Any idea when #19277 will be merged? |
@AndresBena19 +1000 |
Can you help me understand if this when this will be fixed? I am still seeing underscores on the enums in 7.7.0 through 7.10.0. I've tried both this documented variations: |
Looks like this overrode me Under configOptions: additionalProperties : enumPropertyNaming=original,modelPropertyNaming=original</additionalProperties enumPropertyNaming: legacy |
Merged #20172 two weeks ago. Please give it a try with the latest master or snapshot version. |
Can you help me understand where the mvn repo for openapi snapshots can be found? |
Bug Report Checklist
Description
ENUM is being generated with additional "_" character when there's a number on the ENUM name.
openapi-generator version
Issue started on 7.7.0, works fine on 7.7.6.
OpenAPI declaration file content or url
Example ENUM attribute in the YAML spec:
Generation Details
Java 17, Gradle build.
Steps to reproduce
Add ENUM attribute to the spec that has numbers in the attribute name.
Generate java model using openapi generator 7.7.0.
Look into the source code generated, the ENUM attribute names will have an "_" after the number.
For example:
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: