OpenAPITools / OpenAPITools/openapi-generator
[REQ] Use full qualified class name in Swagger annotation
Open
Nobody has claimed this yet.
Enhancement: Feature
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
There is a name conflict with a component class called "Schema". Here is the Gradle config:
openApiGenerate {
generatorName.set("jaxrs-spec")
modelPackage.set("my.package.model")
configOptions.set(
mapOf(
"useJakartaEe" to "true",
"useSwaggerV3Annotations" to "true"
)
)
}
The following code will be generated:
package my.package.model;
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description="Schema")
@jakarta.annotation.Generated(value = "...")
public class Schema implements Serializable {
}
Using full qualified class name like JakartaEe would solve the naming conflict issue.
Thank you!
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 from the jaxrs-spec generator configuration and the generated Java model shown in the issue, then trace how the Swagger Schema annotation is rendered. Done means generated classes named Schema can use the annotation without a name conflict while retaining valid Swagger annotations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100