使用Jersey配置Swagger-ui [英] Config Swagger-ui with Jersey
问题描述
我正在尝试配置Swagger + Swagger-ui + Jersey
.我在 Tomcat 上有我的Web服务.
I am trying to configuring Swagger + Swagger-ui + Jersey
. I have my web service on Tomcat.
我已经能够将招摇者与泽西岛整合在一起.
I have been able to integrate the swagger with Jersey.
要基于swagger-ui documentation
集成swagger-ui
,我需要将文件放在我的webapp目录中的/dist/
下,并将index.html
文件更改为指向我的swagger.json
.但是,我要使用在这里找到的swagger-ui webjar
To integrate swagger-ui
, based on the swagger-ui documentation
, I need to put the files under /dist/
in my webapp directory and changing the index.html
file to point to my swagger.json
. However, I want to use swagger-ui webjar
found here
https://mvnrepository.com/artifact/org.webjars /swagger-ui/2.2.6
我无法弄清楚该怎么做.
I have not been able to figure out how to do this.
推荐答案
我尝试对我的项目使用相同的依赖项,但没有找到更改它的解决方案.我所做的是:
I tried to use this same dependency on my project and didn't find a solution to change it. What I did is:
1)在项目的"webapp"文件夹中创建一个"doc"文件夹
1) Create a "doc" folder inside my "webapp" folder on my project
2)下载 Swagger-ui zip文件
2) Download Swagger-ui zip file
3)提取dist文件夹并将所有文件复制到我的"webapp/doc"文件夹中
3) Extract dist folder and copy all files to my "webapp/doc" folder
4)更改"webapp/doc"中的index.html
4) Change index.html that was in "webapp/doc"
这可能会对您有所帮助.
It might help you.
这篇关于使用Jersey配置Swagger-ui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!