swagger-api / swagger-api/swagger-codegen
jaxrs codegen generates unused imports
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
jaxrs codegen generates the following unused imports in my ApiService class:
import package.generated.api.;
import package.generated.data.*;
import package.generated.data.GeneratedModeal;
import package.generated.api.NotFoundException;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import java.util.List;
import java.io.InputStream;
Really annoying is the dependency to FormDataContentDisposition with forces me to add an unused dependency to my project.
Swagger-codegen version
2.2.0
Command line used for generation
java -Dmodels -Dapis -DapiTests=false -jar swagger-codegen-cli-2.2.0.jar generate -i xxx.yaml -l jaxrs -c config.json
Config
{
"sourceFolder" : "src/main/java",
"implFolder" : "src/main/java",
"modelPackage" : "package.generated.data",
"apiPackage" : "package.generated.api",
"invokerPackage" : "package.invoker",
"library" : "jersey2"
}
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 by reproducing the JAX-RS generation with swagger-codegen-cli 2.2.0, the supplied command, config, and a matching Swagger definition. Inspect the JAX-RS Jersey2 generation entry point and compare the generated ApiService imports; done means unused imports, especially FormDataContentDisposition and the listed package imports, are no longer emitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100