Skip to content

[REQ] [Java] Add annotation Generated in Enum #23832

@jciudadjefe

Description

@jciudadjefe

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions