swagger-api / swagger-api/swagger-codegen
[ALL] System properties no longer working properly
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I'm currently trying to adopt Swagger Codegen 3.0 and noticed that specifying system properties with -D is strangely broken.
More specifically: Executing Codegen 3.0.3 with -Dapis -Dmodel only generates the models but no longer the apis. The same works fine in Codegen 2.3.1.
Swagger-codegen version
The problem exists in 3.0.3. It does not exists in 2.3.1.
Swagger declaration file content or url
Doesn't matter. I've used the PetStore example: https://petstore.swagger.io/v2/swagger.yaml
Steps to reproduce
- Get Codegen 2.3.1: http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar
- Get Codegen 3.0.3: http://central.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.3/swagger-codegen-cli-3.0.3.jar
- Store PetStore.yaml in the same directory as
petstore.swagger.yaml - Generate with 2.3.1:
java -cp swagger-codegen-cli-2.3.1.jar io.swagger.codegen.SwaggerCodegen generate --input-spec petstore.swagger.yaml --lang java --output generated/java/v2 -Dapis -Dmodels - Generate with 3.0.3:
java -cp swagger-codegen-cli-3.0.3.jar io.swagger.codegen.v3.cli.SwaggerCodegen generate --input-spec petstore.swagger.yaml --lang java --output generated/java/v3 -Dapis -Dmodels - Notice how the folder (and contents)
generated/java/v2/src/main/java/io/swagger/client/apiexists while inv3(generated/java/v3/src/main/java/io/swagger/client/api) it doesn't.
I'm running on Windows 10 with Java 8 (1.8.0_191-b12).
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 the Java CLI entry points io.swagger.codegen.SwaggerCodegen and io.swagger.codegen.v3.cli.SwaggerCodegen, then reproduce the commands against the PetStore specification using Codegen 2.3.1 and 3.0.3. Trace how -Dapis and -Dmodels are handled; done means the 3.0.3 command generates both API and model output as the older command does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100