Describe the bug
Using Springdoc 3.0.2 with Spring Boot 4.0.3.
When configuring a WebFluxConfigurer for API Versioning and setting VersionRequired to true, Swagger UI fails.
Specifically, the OpenAPI definition endpoint (/v3/api-docs) returns 404 - Not Found.
I have created a reproducer (attached zip file) based on the path-segment branch in the Git repo https://github.com/springdoc/springdoc-openapi-versioning-demo.
I have changed webmvc dependencies to webflux in the pom.xml, and changed the WebMvcConfigurer to a WebFluxConfigurer. To show the error, I have changed:
.setDefaultVersion("1.0")
.setVersionRequired(false)
to:
.setVersionRequired(true)
To Reproduce
Steps to reproduce the behavior:
-
Download an unzip springdoc-webflux-version-requried-error.zip
-
Build, run, and test
In one terminal:
cd springdoc-webflux-version-requried-error
./mvnw spring-boot:run
In another terminal:
# Expect 200 - OK responses from these reqiuests
curl localhost:8080/api/v1.0/users
curl localhost:8080/api/2.0/users
curl http://localhost:8080/swagger-ui/index.html
# These requests will fail with 404 - Not Found
curl http://localhost:8080/v3/api-docs/swagger-config
curl http://localhost:8080/v3/api-docs
-
Open Swagger UI (http://localhost:8080/swagger-ui/index.html), it will show the error message: "Failed to load remote configuration."
-
Change back to not requiring an API version, and Swagger UI starts to work again, including the two failed requests above.
Expected behavior
- A working Swagger UI when using WebFlux and requiring API Versions to be specified.
Describe the bug
Using Springdoc 3.0.2 with Spring Boot 4.0.3.
When configuring a WebFluxConfigurer for API Versioning and setting VersionRequired to true, Swagger UI fails.
Specifically, the OpenAPI definition endpoint (/v3/api-docs) returns 404 - Not Found.
I have created a reproducer (attached zip file) based on the path-segment branch in the Git repo https://github.com/springdoc/springdoc-openapi-versioning-demo.
I have changed webmvc dependencies to webflux in the pom.xml, and changed the WebMvcConfigurer to a WebFluxConfigurer. To show the error, I have changed:
to:
To Reproduce
Steps to reproduce the behavior:
Download an unzip springdoc-webflux-version-requried-error.zip
Build, run, and test
In one terminal:
In another terminal:
Open Swagger UI (http://localhost:8080/swagger-ui/index.html), it will show the error message: "Failed to load remote configuration."
Change back to not requiring an API version, and Swagger UI starts to work again, including the two failed requests above.
Expected behavior