Skip to content
Advertisement

After upgrade to Spring Boot 3 Swagger UI is not accessable

I had a Spring Boot 2.7.6 app with Spring Security 5.7.5 running without problems: authentication works, I navigate through the different pages according to roles, Swagger UI is usable, etc. I don’t have a deprecated warning for your information.

I migrated to Spring Boot 3.0.0 and therefore Spring Security 6.0.0. I followed the migration guides and the server starts without error. But my URLs no longer work. I have a 401 status.

Issue #1: GET http://localhost:8080/swagger-ui/index.html results in a 401 on client side.

In the logs I have a 404:

JavaScript

pom.xml

JavaScript

SecurityConfig class

JavaScript

WebMvcConfig class

JavaScript

I tried some differents configuration according with

Do you have a search lead because I’m drying up after several attempts?

Advertisement

Answer

I found the solution : with spring boot 3 it seems to use springdoc-openapi-starter-webmvc-ui (https://springdoc.org/v2/). I have added the following dependency and now i can use swagger

JavaScript

The dependency springdoc-openapi-ui is not applicable to spring boot 3. I remo

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement