我正在使用swagger记录java restful api . 此api有两个 endpoints ,只在查询字符串中有所不同 .

GET /resources?id=:id

GET /resources?name=:name

由于两个 endpoints 共享相同的路径和方法,因此swagger ui仅显示一个 endpoints .

我知道swagger目前不支持这个 . 但是,我知道它可以使用url hastag # 欺骗/解决:

https://github.com/OAI/OpenAPI-Specification/issues/182#issuecomment-164037595

我该如何告诉swagger我的 endpoints 可以有一个可选的 #param ,假设我的方法是:

@RequestMapping(method = RequestMethod.GET, params = {"name"})
     public ResponseEntity findResourcesByName(@RequestParam(value = "name") String name) {
         ....
     }

这可能吗?