【发布时间】:2015-09-15 11:07:24
【问题描述】:
最近我在我的一个项目中配置了 swagger。它在 tomcat 上使用 jersey2 和 JAX-WS 来获取宁静的 API。我已经使用以下手册进行配置
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5
${basepath}/swagger.json 响应如下
{"swagger":"2.0","info":{"version":"1.0.0","title":""},"host":"localhost:8080","basePath":" /myapi","schemes":["http"]}
不幸的是,它不包含我的资源包下的任何 api。 我已经尝试过以下问题的答案
swagger - empty listing with no API
但这也无济于事。 使用 com.wordnik.swagger.* 包的上述答案 但是使用手册我得到了 io.swagger.* 包,它没有 JaxrsApiReader 类
我的假设是 swagger 无法从资源包中扫描我的 api 列表。 但无法弄清楚我错过了哪个配置或哪个代码 sn-p。
有什么帮助吗?....
【问题讨论】:
标签: api rest jersey jax-rs swagger