生成REST API的Swagger UI文档 [英] Generating Swagger UI documentation for REST API
问题描述
我在Java中使用JAX-RS / Jersey开发了我的REST API。我想为它转换为/生成基于Swagger的UI文档。任何人都可以告诉我精确/步骤简单的方法如何这样做?对不起,但他们网站上给出的步骤对我来说有点模糊。
I have my REST API developed using JAX-RS/Jersey in Java. I want to convert to/generate Swagger based UI documentation for it. Can anyone please tell me precise/steps in simple way on how to do so? I m sorry but, steps given on their site are little vague for me.
推荐答案
有几种方法可以整合swagger-core使用您的应用程序,但根据您的描述,我只需按照 https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-1.X-Project-Setup-1.5 或 https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5 取决于您使用的Jersey版本。
There are several ways to integrate swagger-core with your application, but based on your description, I'd just follow the wiki page as described either by https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-1.X-Project-Setup-1.5 or https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5 depending on the Jersey version you use.
这些页面还链接到一组样本,您可以将其用作参考,并了解它们的工作原理。他们还将swagger-ui直接插入其中,这样您就可以看到一整套互动。
Those pages also link to a set of samples you can use for reference and see how they work. They also pull in swagger-ui directly into them so you can see a full set of interaction.
这篇关于生成REST API的Swagger UI文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!