详解如何用springRestdocs创建API文档-创新互联
这篇文章将带你了解如何用spring官方推荐的restdoc去生成api文档。本文创建一个简单的springboot工程,将http接口通过Api文档暴露出来。只需要通过 JUnit单元测试和Spring的MockMVC就可以生成文档。
准备工作
- 你需要15min
- Jdk 1.8
- maven 3.0+
- idea
创建工程
引入依赖,其pom文件:
org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test org.springframework.restdocs spring-restdocs-mockmvc test
分享名称:详解如何用springRestdocs创建API文档-创新互联
浏览地址:http://ybzwz.com/article/dphpdp.html