I have migrated to Spring Boot version 3 from 2.7 and Swagger UI stopped working.
Below are the dependencies I have used:
spring-boot-starter-parent - 3.0.0
springfox-boot-starter-3.0.0
springdoc-openapi-starter-webmvc-ui - 2.0.2
springdoc-openapi-core - 1.1.49
I have configured the following property in application.properties
:
springdoc.api-docs.path=/api-docs
but I am still getting 403 error while opening Swagger UI in the bowser (http://localhost:8080/swagger-ui/index.html):
websecurityconfig class made the Swagger UI URL as public with the following code:
String[] PUBLIC_URL = {"/v3/api-docs",
"/v2/api-docs", "/swagger-resources/**",
"/swagger-ui/**",
"/swagger-ui.html",
"/v3/api-docs/**",
"/api-docs/**",
"api-docs" }
http.authorizeHttpRequests().requestMatchers(PUBLIC_URL).permitAll();