Swagger-core: @ApiOperation 以 responseClass 作为列表<t/>

创建于 2013-07-23  ·  3评论  ·  资料来源: swagger-api/swagger-core

你好,

如何将@ApiOperation注释的 responseType 属性设置为对象列表?

最有用的评论

在 swagger-core 1.2.x 中:

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

在 swagger-core 1.3-x 中:

response = YourModel.class, responseContainer="List"

后者的优点是它是类型安全的。

所有3条评论

在 swagger-core 1.2.x 中:

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

在 swagger-core 1.3-x 中:

response = YourModel.class, responseContainer="List"

后者的优点是它是类型安全的。

嗨,我正在使用 responseContainer = "List",但在 swagger UI 上显示的是 List[$ObjectDesc]。 有什么建议吗? 当我尝试使用 responseContainer="Array" 时的情况相同

@vvicario - 如果您有问题,请打开一个单独的问题。

此页面是否有帮助?
0 / 5 - 0 等级