OpenAPITools / OpenAPITools/openapi-generator
[REQ] Simple solution to @javax.annotation.Generated for java11 (no annotations at all?)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Hi,
I used to have the maven plugin (v4.3.1) with openjdk11 (generator jaxrs-jersey) in my project.
At that time, I got some problems with the @javax.annotation.Generated issue and I reached to a simple and
quick solution with the true inside the configOptions section.
No @Generated annotations were present... Maybe this workaround was not the best solution, but It worked.
Today, I am looking for an update in my project to use v5.0.0 version of the plugin. And now came again the
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen").
Yes, the timestamp is not generated, but this annotation does not work for java11 compilation.
Is it possible to add a simple option for adding no "@Generated" annotation until a better java11 suport is done?
Maybe I am missing some better and simple solution. If it is the case, please sorry as I am not considering templates for such a simple thing...
Regards,
PS.: The correct annotation for java 9+ is
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
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 with the jaxrs-jersey generator in the v5.0.0 plugin and inspect how its configuration handles hideGenerationTimestamp and the @Generated annotation. Confirm the desired option's behavior by generating a Java server and compiling it with Java 11; done means generated sources contain no @Generated annotations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100