You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After update to Spring Boot to 3.4.4 version and springdoc webflux ui starter to 2.8.6 the main page Swagger UI
shows by default petstore swagger Open API.
I know that we can use to disable this behavior additional configuration:
But it doesn't work because SwaggerIndexPageTransformer ignored when I open default swagger path for webflux /webjars/swagger-ui/index.html
After some research, I found that Spring added resource handler with org.springframework.web.reactive.resource.CachingResourceTransformer for path /webjars/** in org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration.WebFluxConfig#addResourceHandlers and this is used to process when I open /webjars/swagger-ui/index.html instead SwaggerIndexPageTransformer.
The problem in org.springdoc.webflux.ui.SwaggerWebFluxConfigurer#addResourceHandlers it adds SwaggerIndexPageTransformer for path /swagger-ui and it is not used when we open /webjars/swagger-ui/index.html URL.
We need to add webjarsPrefix to swaggerUiPrefix and then SwaggerIndexPageTransformer will be used for path /webjars/swagger-ui that overrides default Spring CachingResourceTransformer.
To Reproduce
Steps to reproduce the behavior:
Create Spring boot 3.4.4 project and add org.springdoc:springdoc-openapi-starter-webflux-ui:2.8.6 deps.
Create some RestController with Dto's that used OpenAPI.
Open swagger UI for your service, and you will see default petstroe swagger instead of your project /v3/api-docs
Describe the bug
After update to
Spring Boot
to 3.4.4 version andspringdoc webflux ui starter
to 2.8.6 the main page Swagger UIshows by default petstore swagger Open API.
I know that we can use to disable this behavior additional configuration:
But it doesn't work because
SwaggerIndexPageTransformer
ignored when I open default swagger path for webflux/webjars/swagger-ui/index.html
After some research, I found that Spring added resource handler with
org.springframework.web.reactive.resource.CachingResourceTransformer
for path/webjars/**
inorg.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration.WebFluxConfig#addResourceHandlers
and this is used to process when I open/webjars/swagger-ui/index.html
insteadSwaggerIndexPageTransformer
.The problem in
org.springdoc.webflux.ui.SwaggerWebFluxConfigurer#addResourceHandlers
it addsSwaggerIndexPageTransformer
for path/swagger-ui
and it is not used when we open/webjars/swagger-ui/index.html
URL.We need to add
webjarsPrefix
toswaggerUiPrefix
and thenSwaggerIndexPageTransformer
will be used for path/webjars/swagger-ui
that overrides default SpringCachingResourceTransformer
.To Reproduce
Steps to reproduce the behavior:
org.springdoc:springdoc-openapi-starter-webflux-ui:2.8.6
deps./v3/api-docs
Expected behavior
I expected that when I set up
then springdoc will be transforming the index page and use
/v3/api-docs
by default instead petstore swaggerThe text was updated successfully, but these errors were encountered: