Springfox swagger - no api-docs with spring boot jersey and gradle

后端 未结 3 704
-上瘾入骨i
-上瘾入骨i 2021-01-18 20:15

I have a spring boot application with jersey and gradle, and I am trying to automatically generate the API documentation using springfox.

I have followed the steps h

3条回答
  •  醉酒成梦
    2021-01-18 20:46

    As of version 2.5.0 springfox only supports spring-mvc controllers. Jax-rs implementations like jersey aren't supported.

    The current alternative to using springfox is to use the swagger-core library for jax-rs/jersey based services.

    It does have the hooks needed to implement support for jersey in 2.6+. Here is an excerpt of a way to implement it in this issue

    Currently ResourceConfig has a method called "getClasses" which will list everything registerted. like Resources, Filters,etc... Maybe this could help. But be aware that the returning classes could also be filters or any other stuff you could register with jersey2.

提交回复
热议问题