Nav*_*lot 9 java scala swagger swagger-ui
我想在 Swagger ui 中显示两个 REST API 端点:/cart 和 /post。
当我指定 /cart 或 /post 工作正常但都显示我的错误为
规范中没有定义任何操作!
在 swagger-ui 中
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.ant("/cart"))
.paths(PathSelectors.ant("/post"))
.build();
}
Run Code Online (Sandbox Code Playgroud)
小智 4
另一种选择是使用.paths(PathSelectors.any())而不是.paths(PathSelectors.ant("/cart"))和.paths(PathSelectors.ant("/post"))
| 归档时间: |
|
| 查看次数: |
9798 次 |
| 最近记录: |