Swagger-core: @ApiOperation with responseClass as List<T>

Created on 23 Jul 2013  ·  3Comments  ·  Source: swagger-api/swagger-core

Hi,

how can I set responseType attribute of @ApiOperation annotation as List of objects?

Most helpful comment

In swagger-core 1.2.x:

responseClass = "com.yourpackage.YourModel", multiValuedResponse=true

In swagger-core 1.3-x:

response = YourModel.class, responseContainer="List"

The advantage of the latter is that it's typesafe.

All 3 comments

In swagger-core 1.2.x:

responseClass = "com.yourpackage.YourModel", multiValuedResponse=true

In swagger-core 1.3-x:

response = YourModel.class, responseContainer="List"

The advantage of the latter is that it's typesafe.

Hi, I'm using responseContainer = "List", but on swagger UI is showing List[$ObjectDesc]. any suggestion? the same case when I tried to use responseContainer="Array"

@vvicario - please open a separate issue if you have a problem.

Was this page helpful?
0 / 5 - 0 ratings