swagger-api / swagger-api/swagger-codegen
Provide thin jar for swagger-codegen
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Similar to swagger-api/swagger-parser#1515, #10853, and https://github.com/swagger-api/swagger-codegen/issues/10854, we want to be able to call SwaggerCodegen.main programmatically.
But the swagger-codegen jar is published as an executable jar, because the assumption was that it would be run from a command line.
Because an executable jar (a.k.a. fat jar, a.k.a. shadow jar) has every class needed to execute, it put thousands of classes on our classpath, many of which conflict with other classes (in fact, it made the code generator malfunction until we realized the problem).
For now, we had to fork the classes from the swagger-codegen jar into our codegen project:
src/main/java/io/swagger/codegen/v3/cli/CLIHelper.java
src/main/java/io/swagger/codegen/v3/cli/SwaggerCodegen.java
src/main/java/io/swagger/codegen/v3/cli/cmd/ConfigHelp.java
src/main/java/io/swagger/codegen/v3/cli/cmd/Generate.java
src/main/java/io/swagger/codegen/v3/cli/cmd/Langs.java
src/main/java/io/swagger/codegen/v3/cli/cmd/Meta.java
src/main/java/io/swagger/codegen/v3/cli/cmd/Validate.java
src/main/java/io/swagger/codegen/v3/cli/cmd/ValidateException.java
src/main/java/io/swagger/codegen/v3/cli/cmd/Version.java
We really didn't want to have to fork anything.
We'd like to be able to depend on a thin version of swagger-codegen, which you could enable by publishing two artifacts instead of one, with the thin artifact having a different artifactId.
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
Review the current executable-jar packaging and the listed CLI classes under src/main/java/io/swagger/codegen/v3/cli. Compare the related issues referenced in the report to understand the intended artifact split. Done means publishing a second artifact with a distinct artifactId that provides the CLI classes without bundling all executable-jar dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100