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使用样例
- Host: GitHub
- URL: https://github.com/dyc87112/swagger-starter-demo
- Owner: dyc87112
- Created: 2017-08-24T01:29:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-22T14:46:40.000Z (about 4 years ago)
- Last Synced: 2025-04-22T23:33:55.712Z (6 months ago)
- Language: Java
- Size: 17.6 KB
- Stars: 59
- Watchers: 4
- Forks: 57
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
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);
}
}
```