赞
踩
配置springdoc_springdoc-openapi-starter-webmvc-api-CSDN博客
0: 依赖 springboot3之后,jakarta包代替javax,并且gateway使用webflux代替webmvc
- //原始版本
- <!-- <dependency>-->
- <!-- <groupId>org.springdoc</groupId>-->
- <!-- <artifactId>springdoc-openapi-starter-webflux-ui</artifactId>-->
- <springdoc-openapi.version>2.3.0</springdoc-openapi.version>
- <!-- </dependency>-->
-
- //增强版
- <dependency>
- <groupId>com.github.xiaoymin</groupId>
- <artifactId>knife4j-openapi3-webflux-jakarta-spring-boot-starter</artifactId>
- <version>4.5.0</version>
- </dependency>
1: yml
- springdoc:
- swagger-ui:
- urls:
- - name: gateway
- url: /v3/api-docs
- - name: xxx
- url: /v3/api-docs/xxx
2: gateway
- routes:
- - id: openapi
- uri: http://localhost:${server.port}
- predicates:
- - Path=/v3/api-docs/**
- filters:
- - RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/v3/api-docs
3:config
4:打开
原Swagger文档: http://localhost:0000/swagger-ui.html
knife4j文档: http://localhost:0000/doc.html
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。