我们正在向 Spring 应用程序添加(大摇大摆)OpenAPI 3,
我们还有 Jersey 端点(使用 @Path
),来自 docs不支持
Does springdoc-openapi support Jersey?
If you are using JAX-RS and as implementation Jersey (@Path for example), we do not support it.
我们可以做什么来公开 Jersey 端点?我们必须转向 Spring 的 @RestController
,还是有 Jersey 支持或解决方法?
发现关闭issue
We only support exposing Rest Endpoints using spring managed beans (
@RestController
for example). You can have a look at swagger-jaxrs2 if it can help:
https://github.com/swagger-api/swagger-samples/tree/2.0/java/java-jersey2-minimal
最佳答案
解决方案是将 Jersey 端点迁移到 @RestController
。
例如更改:
@ApplicationPath
-> @RequestMapping
@QueryParam
-> @RequestParam
@Path
+ @POST
-> @PostMapping
关于java - OpenAPI 3 支持 Jersey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67899145/