OpenAPITools / OpenAPITools/openapi-generator
How could I add custom annotation @Generator or other annotation to all class in Java
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
I want to add custom annotation to all classes that is generated by openapi. Something like @Generated so Jacoco can exclude those classes. Currently generator does support adding annotation to model classes but I want to add it all the classes. I do see @javax.annotation.Generated on all classes but the retention policy is SCOPE so jacoco is not able to exclude those classes from the report.
Is there any functionality like this additionalModelTypeAnnotations: '@lombok.Generated' that supports adding annotations to all classes?
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.
Research direction
Start by reviewing how additionalModelTypeAnnotations is handled and how @javax.annotation.Generated is emitted across generated classes. Compare model generation with the other generated class types and determine how a configurable annotation could apply to all of them. Done means the requested annotation is consistently emitted and Jacoco can exclude the generated classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100