cancel
Showing results for 
Search instead for 
Did you mean: 

Error while compiling swagger-codegen java Petstore sdk

aman3005
Occasional Visitor

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/Pet.java:[87,34] cannot find symbol
[ERROR] symbol: method nextObject()
[ERROR] location: variable jsonReader of type com.google.gson.stream.JsonReader

it is using 2.8.1 as dependency.

Any ideas on how to fix this?

New Here?
Join us and watch the welcome video:
Announcements