com.github.wangyuheng:swagger-starter

spring-boot swagger starter

License

License

Categories

Categories

Swagger Program Interface REST Frameworks
GroupId

GroupId

com.github.wangyuheng
ArtifactId

ArtifactId

swagger-starter
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

com.github.wangyuheng:swagger-starter
spring-boot swagger starter
Project URL

Project URL

https://github.com/wangyuheng/spring-boot-swagger-starter
Project Organization

Project Organization

Pivotal Software, Inc.
Source Code Management

Source Code Management

https://github.com/wangyuheng/spring-boot-swagger-starter

Download swagger-starter

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.wangyuheng/swagger-starter/ -->
<dependency>
    <groupId>com.github.wangyuheng</groupId>
    <artifactId>swagger-starter</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.wangyuheng/swagger-starter/
implementation 'com.github.wangyuheng:swagger-starter:0.0.1'
// https://jarcasting.com/artifacts/com.github.wangyuheng/swagger-starter/
implementation ("com.github.wangyuheng:swagger-starter:0.0.1")
'com.github.wangyuheng:swagger-starter:jar:0.0.1'
<dependency org="com.github.wangyuheng" name="swagger-starter" rev="0.0.1">
  <artifact name="swagger-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.wangyuheng', module='swagger-starter', version='0.0.1')
)
libraryDependencies += "com.github.wangyuheng" % "swagger-starter" % "0.0.1"
[com.github.wangyuheng/swagger-starter "0.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar 1.4.2.RELEASE
io.springfox : springfox-swagger2 jar 2.6.1
io.springfox : springfox-swagger-ui jar 2.6.1

Project Modules

There are no modules declared in this project.

spring-boot-swagger-starter

spring-boot项目快速添加swagger包括swagger-ui,用于管理接口文档以及页面调试

使用方法

0.0.1已发布到maven中央仓库,欢迎使用

    <dependency>
        <groupId>com.github.wangyuheng</groupId>
        <artifactId>swagger-starter</artifactId>
        <version>0.0.1</version>
    </dependency>

如果下载失败,可以发布starter到本地仓库 在SwaggerStarter目录执行

    mvn clean install 

此命令可以将jar添加进本地仓库

运行demo

在SwaggerStarterDemo目录执行

    mvn spring-boot:run 

可以启动spring-boot项目,默认端口号为8080,在浏览器访问http://localhost:8080/,可以看到demo接口事例。 或者可以将项目导入常用IDE运行。

编辑配置文件

配置文件路径为 spring-boot-swagger-starter/SwaggerStarterDemo/src/main/resources,修改对应的配置项,重新启动可以在demo页面查看变动。

配置参数

    swagger:
      groupName: 分类(groupName)
      title: 标题(title)
      description: 介绍(description)
      termsOfServiceUrl: 服务URL(termsOfServiceUrl)
      version: 版本(version)
      contactName: 作者名(contactName)
      contactUrl: 作者主页(contactUrl)
      contactEmail: 作者邮箱(contactEmail)
      paths: /upload.*,/category.*
      license:
      licenseUrl:

设计

starter为方便项目使用,尽量简化,不添加无用依赖,自动化部分设置,留出配置文件方便定制化。

Versions

Version
0.0.1