Spring mvc 虚张声势允许值范围问题

Spring mvc 虚张声势允许值范围问题,spring-mvc,range,swagger,Spring Mvc,Range,Swagger,以下是我在@ApiParam中使用allowableValues的一段代码: @RequestMapping(value = {"/operations/parameters/allowableRange/{id}"}, method = GET, produces = APPLICATION_JSON_VALUE) @ResponseBody public String allowableRange( @ApiParam(defaultValue = "1", allowableValues

以下是我在@ApiParam中使用allowableValues的一段代码:

@RequestMapping(value = {"/operations/parameters/allowableRange/{id}"}, method = GET, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public String allowableRange(
@ApiParam(defaultValue = "1", allowableValues = "range[1, 99]")
@PathVariable Integer id) {
return "";
}

@RequestMapping(value = {"/operations/parameters/allowableValues/{id}"}, method = GET, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public String allowableValues(
@ApiParam(defaultValue = "1", allowableValues = "1,2,3,4,5")
@PathVariable Integer id) {
return "";
}

我尝试了同样的方法,但我们提供的范围不起作用,我甚至可以给出id为1000(范围为1-99),它仍然有效。我的招摇过市版本是0.8.8。我遗漏了什么?

Swagger只是一个API文档工具,所以从技术上讲它什么都不做。

您是说Swagger ui不尊重您指定的范围,并且ui没有将输入限制到指定的范围这一事实吗?是的,这就是问题所在