Trying to enable swagger ui for my springboot application. Getting 404 when hitting the swagger-ui endpoint
Springboot version: 3.0.5 using: org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0
springdoc:
pathsToMatch: /**
api-docs:
groups:
enabled: true
enabled: true
path: /v3/api-docs
version: openapi_3_0
packagesToScan: com.flipkart.marketplace.infrastructure.adapter.web
show-actuator: true
swagger-ui:
path: /swagger-ui.html
Infact no endpoint is working related to spring-docs. Getting 404 for all usecase
@Configuration
public class SecurityConfig {
@Bean
public SecurityWebFilterChain apiHttpSecurity(final ServerHttpSecurity http) {
http
.securityMatcher(new OrServerWebExchangeMatcher(
new PathPatternParserServerWebExchangeMatcher("/**"),
new PathPatternParserServerWebExchangeMatcher("/actuator/**")))
.csrf().disable()
.authorizeExchange(exchanges -> exchanges
.anyExchange()
//.authenticated()
.permitAll()
);
//.oauth2ResourceServer(ServerHttpSecurity.OAuth2ResourceServerSpec::jwt);
return http.build();
}
@Bean
public SecurityWebFilterChain webHttpSecurity(final ServerHttpSecurity http) {
http
.authorizeExchange(exchanges -> exchanges
.pathMatchers(
"/v3/api-docs/**", "/v3/api-docs.yaml", "/v3/api-docs.yaml/**",
"/swagger-ui/**", "/swagger-ui.html", "/webjars/swagger-ui/**")
.permitAll()
.anyExchange().authenticated()
)
.httpBasic(withDefaults());
return http.build();
}
}
Also using default context path