如何在swagger-api ApiOperation注释部分中设置文本格式

时间:2017-07-28 21:59:03

标签: java swagger

如何在swagger-api notes部分添加一个列表作为终点? 像这样的东西

  List of supported filters are
       1. list of performers only
       2. list list of activities only                 
       3. active/inactive flag in combination with performer

1 个答案:

答案 0 :(得分:0)

@ApiOperation注释接受html标记。但是,取决于所使用的摇号版本,它似乎是简单的子集或越野车。 (例如,我无法用招摇的方法2创建编号列表。)

这两个都非常接近:

@ApiOperation(
value="value",
notes="List of supported filters are<br>1. list of performers only<br>2. list list of activities only <br>3. active/inactive flag in combination with performer"
)

@ApiOperation(
value="value",
notes="List of supported filters are<ol><li>list of performers only</li><li>list list of activities only</li><li>active/inactive flag in combination with performer</li></ol>"
)