1
怎么让 Swagger UI 展示 @ApiResponse 的多个 examples?
source link: https://www.v2ex.com/t/811951
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
我有如下代码
@ApiResponses(
{
@ApiResponse(
code = 500, message = "业务异常", response = ErrorResponse.class,
examples = @Example(value = {
@ExampleProperty(mediaType = MediaType.APPLICATION_JSON_VALUE, value = "{\"error\": {\"code\": \"BUSINESS_EXCEPTION\", \"message\": \"xxx\"}}"),
@ExampleProperty(mediaType = MediaType.APPLICATION_JSON_VALUE, value = "{\"error\": {\"code\": \"BUSINESS_EXCEPTION\", \"message\": \"---\", \"data\": [\"item1\", \"item2\"]}}")
})
)
}
)
但是 Swagger UI 却只展示了其中一个 example ,怎么让它展示出所有 examples 呢?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK