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
There was a change introduced in 2.1.0 that changes the way Swagger assets are resolved in webjars (commit). The SpringDocUIConfiguration has @ConditionalOnExpression("${springdoc.api-docs.enabled:true}") which prevents my application from working properly (it worked fine on 2.0.x) - when I hit the endpoint configured in springdoc.swagger-ui.path I am redirected to a URL that is not then resolved by Springdoc's SwaggerResourceResolver
To Reproduce
Version: 2.1.0
Dependency: org.springdoc:springdoc-openapi-starter-webmvc-ui
Spring Boot 3.0.8
Steps to reproduce the behavior:
In application.yml
set springdoc.api-docs.enabled: false
set springdoc.swagger-ui.path: /my-url
Open the URL in a web browser
Result: I'm receiving a 302 response with a Location which is then incorrectly resolved - web browser receives 404.
Expected behavior: I should be correctly redirected to Swagger's index.html
Additional context
For now, I'm using a workaround:
@Bean SpringDocConfigFix springDocConfigFix(SwaggerUiConfigProperties props) {
return new SpringDocConfigFix(Optional.of(props));
}
static class SpringDocConfigFix extends SpringDocUIConfiguration {
public SpringDocConfigFix(
Optional<SwaggerUiConfigProperties> optionalSwaggerUiConfigProperties) {
super(optionalSwaggerUiConfigProperties);
}
}
The text was updated successfully, but these errors were encountered:
There was a change introduced in
2.1.0
that changes the way Swagger assets are resolved in webjars (commit). TheSpringDocUIConfiguration
has@ConditionalOnExpression("${springdoc.api-docs.enabled:true}")
which prevents my application from working properly (it worked fine on2.0.x
) - when I hit the endpoint configured inspringdoc.swagger-ui.path
I am redirected to a URL that is not then resolved by Springdoc'sSwaggerResourceResolver
To Reproduce
Version:
2.1.0
Dependency:
org.springdoc:springdoc-openapi-starter-webmvc-ui
Spring Boot
3.0.8
Steps to reproduce the behavior:
application.yml
springdoc.api-docs.enabled: false
springdoc.swagger-ui.path: /my-url
Result: I'm receiving a 302 response with a
Location
which is then incorrectly resolved - web browser receives 404.Expected behavior: I should be correctly redirected to Swagger's
index.html
Additional context
For now, I'm using a workaround:
The text was updated successfully, but these errors were encountered: