[REQ] [Java] Add annotation Generated in Enum
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache and inspect how generatedAnnotation is used in the template. Generate a JavaSpring model containing an enum and verify that the resulting enum includes jakarta.annotation.Generated, while preserving the existing POJO behavior.
Written by the indexing model from the issue text.
Description
Within a Java/Quarkus project, I generate models from a YAML, using this openapi-generator-maven-plugin (version 7.22.0).
In POJOs, there's annotation @jakarta.annotation.Generated. But Enum don't have this one
My issue is with plugin ErrorProne, there's a flag available XepDisableWarningsInGeneratedCode, which allows us to ignore warnings triggered by generated code. ErrorProne.info
But since my generated Enums don't have this annotation, Warnings are triggered
I can add annotation @Generated in openapi-generator-maven-plugin with the additionalEnumTypeAnnotations
I'm wondering why generated Enum don't have this annotation by default, like POJOs ?
See there : https://github.com/OpenAPITools/openapi-generator/blob/fd651513978c5f2ac7028caee9c5caa841d0b6c1/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache for a correction, to use generatedAnnotation ? I'm not familiar with "mustache" language
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 103
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.
More from OpenAPITools/openapi-generator
-
Issue: Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
OpenAPITools/openapi-generator#24978 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenAPITools/openapi-generator#24975 ·
-
Issue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenAPITools/openapi-generator#24859 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenAPITools/openapi-generator#24852 · 1 comment ·
-
[BUG][KOTLIN] Fails to compile after updating to 7.25.0 with useJackson3=false useSpringBoot4=true OpenIssue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenAPITools/openapi-generator#24842 · 1 comment ·
All issues in OpenAPITools/openapi-generator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100