Even though I have made the Swagger settings correctly, it says No API definition provided in the UI.
All endpoints are available at http://localhost:8080/v3/api-docs.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.3.0</version>
</dependency>
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.cors(Customizer.withDefaults())
.csrf(AbstractHttpConfigurer::disable)
.authorizeRequests()
.requestMatchers("/auth/register/**").permitAll()
.requestMatchers("/auth/login/**").permitAll()
.requestMatchers("/v3/api-docs").permitAll()
.requestMatchers("/v3/api-docs/**").permitAll()
.requestMatchers("/swagger-ui.html").permitAll()
.requestMatchers("/swagger-ui/**").permitAll()
.requestMatchers("/docs/**").permitAll()
.anyRequest().authenticated()
.and()
.addFilterBefore(new JwtAuthenticationFilter(jwtService, userDetailsService), UsernamePasswordAuthenticationFilter.class);
return http.build();
}
Data comes in http://localhost:8080/v3/api-docs, but not in http://localhost:8080/swagger-ui/index.html. Why could it be?
Swagger image