如何在swagger2 html中显示默认值?

时间:2019-01-14 02:35:48

标签: swagger swagger-ui swagger-2.0

我尝试从http://docs.swagger.io/swagger-core/apidocs/com/wordnik/swagger/annotations/ApiImplicitParam.html.And读取文档,设置像这样的值,但是html仍然没有默认值。 它的paramType为“ body”时无法设置?

 @PostMapping
@RequestMapping(value = {"/"}, produces = {"application/json; charset=UTF-8"}) 
@ApiOperation(value = "test",consumes="application/json, application/xml", notes = "test", httpMethod = "POST", tags = "Open Api")
@ApiImplicitParams({ @ApiImplicitParam(name = "demoExample", 
value = "test", dataType = "String", paramType = "body",
defaultValue="<?xml  version=\"1.0\"  encoding=\"utf-8\"?>"
        + "<root>" 
        + "I am a student"
        + "</root>"),
})
public void test(HttpServletRequest request, HttpServletResponse response) throws IOException { ...}

0 个答案:

没有答案