How to integrate Swagger UI in Spring Boot 3 using springdoc-openapi
This beginner-friendly tutorial shows how to document REST APIs in Java using Swagger UI, customize OpenAPI metadata, group and version endpoints, and secure the Swagger interface — all with Spring Boot 3 and Java 21.
We use springdoc-openapi, the modern replacement for Springfox, to keep things clean and up to date.
Perfect for backend developers documenting production-ready APIs.
Works with Java 17+ and Spring Boot 3
Powered by Liberica JDK by BellSoft — a secure OpenJDK alternative
00:00 Start: Swagger in Spring Boot
00:29 What is Swagger
02:36 How to add Swagger UI with springdoc-openapi
02:13 Open Swagger UI in the browser
03:06 Annotate Spring REST API endpoints with @Operation
06:46 Customize OpenAPI metadata: title, version, contact
06:05 Group and version your APIs in Spring Boot
07:21 Secure Swagger UI using Spring Security
08:41 Full recap: Swagger documentation in production