springdoc-openapi icon indicating copy to clipboard operation
springdoc-openapi copied to clipboard

Facing the same issue [springdoc v.2.6.0]. swagger ui and springdoc.config.properties are both in 5.13.0 version.

Open GuillaumeMartial opened this issue 2 years ago • 0 comments

          Facing the same issue [springdoc v.2.6.0]. swagger ui and springdoc.config.properties  are both in 5.13.0 version.

my versions : springboot 3.3.2 jdk 21

no problem to access to http://localhost:9000/v0/v3/api-docs but http://localhost:9000/v0/swagger-ui/index.html throws me an 500 error : { "message": "No endpoint GET /v0/swagger-ui/index.html.", "status": 500 }

To reproduce :

application-dev.yml :

server: port: 9000 servlet: context-path: /v0

SpringSecurityConfig :

http.csrf(AbstractHttpConfigurer::disable)
                .formLogin(AbstractHttpConfigurer::disable)
                .httpBasic(AbstractHttpConfigurer::disable)
                .authenticationManager(authenticationManager)
                .securityContext(httpSecuritySecurityContextConfigurer -> httpSecuritySecurityContextConfigurer.securityContextRepository(securityContextRepository))
                .exceptionHandling(exceptionHandlingSpec -> exceptionHandlingSpec.authenticationEntryPoint(simpleAuthenticationEntryPoint))
                .authorizeHttpRequests(authorizationManagerRequestMatcherRegistry -> authorizationManagerRequestMatcherRegistry.requestMatchers(HttpMethod.OPTIONS).permitAll()
                        .requestMatchers(HttpMethod.GET, "/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**", "/v0/webjars/**", 
                         "/webjars/**", "/swagger-resources/**", "/actuator/**").permitAll()
                        .anyRequest().authenticated()).build();

Thanks for your help !

Originally posted by @GuillaumeMartial in https://github.com/springdoc/springdoc-openapi/issues/2605#issuecomment-2304104382

GuillaumeMartial avatar Aug 22 '24 08:08 GuillaumeMartial