[英]swagger 2 spring boot - having 2 APIs of the same name but only display one of it
I have 2 APIs with the same name for a reason.出于某种原因,我有 2 个同名的 API。
First one第一
@ApiOperation(value="")
@RequestMapping(value="/predict", method= RequestMethod.POST, produces="application/json", headers="content-encoding=gzip")
public ResponseEntity<?> predictBinary(HttpServletRequest requestEntity, @RequestHeader Map<String, Object> header) {
Second one第二个
@ApiOperation(value="")
@RequestMapping(value="/predict", method= RequestMethod.POST, produces="application/json", consumes="application/json")
public ResponseEntity predict(@RequestBody RequestInput inputs, @RequestHeader Map<String, Object> header) {
Is there a way to only display the second one?有没有办法只显示第二个? Right now swagger randomly chooses one to display, sometimes I see the First one
sometimes I see the Second one
I tried removing the @ApiOperation for the First one
it doesn't help.现在swagger随机选择一个显示,有时我看到First one
有时我看到Second one
我尝试删除First one
的@ApiOperation它没有帮助。
您可能会尝试像现在一样使用 /predict 更改自己的路径,这可能是因为 spring 控制器可能存在模棱两可的问题,因此最好为每个路径使用不同的路径,并且 swagger 可能也会发生同样的情况,因此它会随机获取这些 API 详细信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.