OpenAPI/Swagger UI & Codegen with Spring Boot

Tejas Ozarkar
The Startup
Published in
3 min readJun 25, 2020

--

OpenAPI(Formerly known as Swagger) is a set of tools built for developers to design, build, and document REST API’s.

In this tutorial, we are going to look at Swagger UI and Codegen. And step by step configured it with Spring Boot Application.

Step 1: Configure Swagger UI

To add Swagger-UI in our application we just need to add the following dependency in pom.xml.

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.2.32</version>
</dependency>

Now just execute maven goal

mvn clean install

Run the app and open your browser with the following link

http://localhost:8080/swagger-ui.html

If you can see this screen then you have configured Swagger UI successfully.

Note: If you are getting Whitelabel Error Page try to restart your IDE and run the project again.

Step 2: Configure Swagger Codegen

--

--