swagger-api / swagger-api/swagger-codegen-generators
The templates for openApi3 for jaxrs-spec contain imports that are from swagger 2 lib
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
The pojo.mustache for JavaJaxRS/spec (https://github.com/swagger-api/swagger-codegen-generators/blob/master/src/main/resources/handlebars/JavaJaxRS/spec/pojo.mustache#L1) contains
import io.swagger.annotations.*;
Shouldn’t this be:
{{#useOas2}}
import io.swagger.annotations.*;
{{/useOas2}}
{{^useOas2}}
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
{{/useOas2}}
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 src/main/resources/handlebars/JavaJaxRS/spec/pojo.mustache, especially its import section. Check how the template distinguishes useOas2 from OpenAPI 3, then generate JavaJaxRS spec output for both cases. Done means each generated variant contains the corresponding annotation imports without mixing Swagger 2 and OpenAPI 3 libraries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100