OpenAPITools / OpenAPITools/openapi-generator

[REQ] JVM code gen to use a @Genereated annotation that has at least CLASS retention so that coverage can be ignored

Open
#17,839 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

Javaoco automatically ignores classes annotated as @Generated as long as the annotation persists into the class.
Unfortunately the @Generated annotation is use only has SOURCE retention.

Describe the solution you'd like

Pick any @Generated annotation with CLASS and switch to that annotation.
For backwards compatibility consider include this new annotation on top of the existing one you are using.
It doesn't matter which CLASS level @Generated annotation you use so if you want just generate a @Generated
annotation class in during the code gen.

Describe alternatives you've considered

Manually listing classes and setting specific config in the build is tedious.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the JVM code-generation entry points and the existing @Generated annotation usage. Check how generated classes retain annotations and verify that the selected annotation is present in compiled output so coverage tools can ignore those classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
testing-qa, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.