SpringBootSwaggerStarter 2.0.5 发布,补充 UI 文件

栏目: Java · 发布时间: 7年前

内容简介:此次升级,将版本号与spring boot版本号同步,以后发布均会使用一致的版本号字符串。从这个版本开始自带基本配置文件,可以不自己写配置了

SpringBootSwaggerStarter ,用于简化在spring boot的web项目中使用swagger展示api的操作,依据spring boot官方的命名建议,在maven中使用“swagger-spring-boot-starter”的坐标。

此次升级,将版本号与spring boot版本号同步,以后发布均会使用一致的版本号字符串。

从这个版本开始自带基本配置文件,可以不自己写配置了

这次还单独准备了一个附加的组件,用于准备swagger-ui的静态资源文件,添加依赖即可

<dependency>
    <groupId>cn.songxinqiang</groupId>
    <artifactId>swagger-spring-boot-starter-ui</artifactId>
    <version>2.0.5.RELEASE</version>
</dependency>

这个是在springfox提供的文件基础上修改的,将按钮文字切换为中文,简化介绍文字,维持使用2.8.0版本的ui样式,新版本变化较大。

升级之后在maven配置文件之中的配置就修改为

<profiles>
    <profile>
        <id>develop</id>
        <dependencies>
            <dependency>
                <groupId>cn.songxinqiang</groupId>
                <artifactId>swagger-spring-boot-starter</artifactId>
                <version>2.0.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>cn.songxinqiang</groupId>
                <artifactId>swagger-spring-boot-starter-ui</artifactId>
                <version>2.0.5.RELEASE</version>
            </dependency>
        </dependencies>
    </profile>
</profiles>

这就是所需的配置了,如果对描述信息自定义的话,可以在application.properties文件中添加

#配置swagger的api信息
swagger.api.name=demo
swagger.api.title=Demo API
swagger.api.description=SwaggerSpringBootStarter 使用样例,一切就是这么简单
swagger.api.version=2.0.4
swagger.api.contactUser=阿信sxq
swagger.api.contactUrl=https://my.oschina.net/songxinqiang
swagger.api.contactEmail=

这样在进行编辑或者打包的时候加上参数 develop 就可以了。

具体的说明可以参考介绍博客。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithm Analysis in Java

Data Structures and Algorithm Analysis in Java

Mark A. Weiss / Pearson / 2006-3-3 / USD 143.00

As the speed and power of computers increases, so does the need for effective programming and algorithm analysis. By approaching these skills in tandem, Mark Allen Weiss teaches readers to develop wel......一起来看看 《Data Structures and Algorithm Analysis in Java》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具