Generating Rest API documentation using swagger or any other tool(使用 swagger 或任何其他工具生成 Rest API 文档)
问题描述
我正在寻找一种方法来记录我的 Rest API.我的服务器是 Tomcat/Spring 服务器,其余 API 使用 Jenkins 实现.
I am looking for a way to document my Rest APIs. My server is a Tomcat/Spring server and the Rest APIs are implemented using Jenkins.
Swagger 似乎是一个非常酷的解决方案,但我不知道如何在我的代码中使用它.我正在寻找创建 json swagger-ui 可以读取的最佳方法 - 我应该怎么做?
Swagger seems to be a pretty cool solution but i can't figure out how i can use it with my code. I am looking for the best way to create the json swagger-ui can read - how i should do that?
另外,我很乐意检查在这种环境中记录 Rest API 的任何其他好的解决方案.
Also, i would be happy to check any other good solutions for documenting Rest APIs in such environment.
推荐答案
swagger我没试过,你可以试试enunciate.它可以生成 JAX-RS 端点的文档作为 javadoc 阶段的一部分.enunciate page
I haven't tried swagger but you may try enunciate. It can generate documentation of JAX-RS endpoints as a part of javadoc phase. Some examples of generated documentation are available on enunciate page
更新
项目已移至 http://enunciate.webcohesion.com/,将支持 java 8通过即将发布的 2.0 版.
Project has been moved to http://enunciate.webcohesion.com/, java 8 will be supported by upcoming version 2.0.
这篇关于使用 swagger 或任何其他工具生成 Rest API 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 swagger 或任何其他工具生成 Rest API 文档


基础教程推荐
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01