Open skrysmanski opened 5 years ago
Found a workaround: the -D
parameters must be specified before the main class name, like this:
java -Dapis -Dmodels -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
Still the question remains while this used to work fine.
Hello,
Thanks @skrysmanski your comments help me a lot.
I get issue with -D parameters
With 2.4.2 and 2.4.5 version on CodeGen install via brew.
If we try to use -Dapis=Pet,Store
parameter swager-codegen generate -i http://petstore.swagger.io/v2/swagger.json -Dapis=Pet,Store -l javascript -o /
only the first api is generated.
If I use @skrysmanski method it's working well (test with version 2.4.5)
Found a workaround: the
-D
parameters must be specified before the main class name, like this:
java -Dapis -Dmodels -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
Still the question remains while this used to work fine.
Test on MacOs 10.13.6 with Java 1.8.0_191-b12
Ran into same issue, earlier
..io.swagger.codegen.v3.cli.SwaggerCodegen generate -Dkey1=val1 -Dkey2=val2 used to work with 3.0.18 only key2=val2 is honored rest are ignored
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
petstore.swagger.yaml
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
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
generated/java/v2/src/main/java/io/swagger/client/api
exists 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).