swagger-api / swagger-api/swagger-codegen-generators

The templates for openApi3 for jaxrs-spec contain imports that are from swagger 2 lib

Open
#843 0 comments 1 reaction 0 assignees View on GitHub

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.