An open API service indexing awesome lists of open source software.

https://github.com/dyc87112/swagger-starter-demo

spring-boot-starter-swagger使用样例
https://github.com/dyc87112/swagger-starter-demo

Last synced: 3 months ago
JSON representation

spring-boot-starter-swagger使用样例

Awesome Lists containing this project

README

          

# swagger-starter-demo

spring-boot-starter-swagger使用样例

## Swagger 前台访问地址

前台地址,根据使用的spring-boot-starter-swagger版本,不同地址如下:

- 1.x版本:http://{ip}:{port}/{server.servlet.context-path}/swagger-ui.html
- 2.x版本:http://{ip}:{port}/{server.servlet.context-path}/swagger-ui/index.html

当前 Demo 前台地址:http://localhost:8080/swagger-ui/index.html

## 安装

添加依赖

pom.xml

```xml

com.spring4all
swagger-spring-boot-starter
2.0.0-RELEASE

```

下 XXXApplication.java 启动文件中添加外部扫描包 com.spring4all.swagger

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