OpenAPITools / OpenAPITools/openapi-generator

[REQ] Simple solution to @javax.annotation.Generated for java11 (no annotations at all?)

Open
#8,284 0 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

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.