Forum Discussion

aman3005's avatar
Occasional Visitor
4 years ago

Error while compiling swagger-codegen java Petstore sdk

I am trying to generate a java API using swagger-codegen (3.0.0)
I am using the swagger-codegen-cli-3.0.24.jar version of codegen jar.
I ran the following command to generate the SDK for the sample petstore project:

java -jar swagger-codegen-cli.jar generate -i code/swagger-codegen/modules/swagger-codegen/src/test/resources/3_0_0/petstore.json -l java -o out/pet-java

When I am compiling the generated sdk project:
cd out/pet-java
mvn clean package

I am getting the below error:

Compilation failure
[ERROR] out/pet-java/src/main/java/io/swagger/client/model/[87,34] cannot find symbol
[ERROR] symbol: method nextObject()
[ERROR] location: variable jsonReader of type

it is using 2.8.1 as dependency.

Any ideas on how to fix this?

No RepliesBe the first to reply