Reputation: 5843
For example:
java -jar swagger-codegen-cli-2.2.1.jar generate -i http://weburl/apidocs/swagger.json -l java -o output
In the generated files, there is a ModelAPI.java, where in the method (corresponding to HTTP GET request) returns void.
I expected the POJO object (corresponding to json of the response) to be returned, but void is returned.
Is there a way to generate POJO objects, so that when I use the client SDK in my code, I can use the POJO object?
Am I missing something?
Upvotes: 2
Views: 2247
Reputation: 5843
The output of swagger codegen is based on the input - swagger api specification.
The reason for void is because in the specification, for response: 200, schema was not specified.
For example:
responses:
'200':
description: successful operation
schema:
$ref: '#/definitions/Pet'
Please have a look at:
https://github.com/swagger-api/swagger-codegen/issues/3888
Upvotes: 5