Spring Boot

swagger简介及使用

2018-09-27  本文已影响0人  飞逝1

swagger的由来

同类技术

swagger生态图

20170827202033991.png

swagger UI

示例


整个页面.png

展开界面


展开界面.png

swagger-editor

就是一个在线编辑文档说明文件(swagger.json或swagger.yaml文件)的工具,以方便生态中的其他小工具(swagger-ui)等使用。 左边编辑,右边立马就显示出编辑内容来。


swagger-editor.jpg

使用方法

@SpringBootApplication
@EnableSwagger2Doc
    public class Springboot2Swagger2Application {
        public static void main(String[] args) {
        SpringApplication.run(Springboot2Swagger2Application.class, args);
    }
}

默认情况下就能产生所有当前SpringMVC加载的请求映射文档
访问地址:http://localhost:8080/swagger-ui.html

代码

https://github.com/1094064939/SpringBootExample

上一篇下一篇

猜你喜欢

热点阅读