OpenAPI Specification (OAS) 3.0

1. Introduction to OpenAPI

OpenAPI Specification (formerly known as Swagger Specification) is a widely adopted standard used to define, describe, and document RESTful APIs in a human-readable and machine-readable format.

2. For adding OpenAPI into your spring boot application, you need to add these dependencies in pom.xml

3. Add @RestController and @RequestMapping(“/api”) to your controller classess.

4. For advance OpenAPI configuration, you can define a bean class and annotate it with @Configuration annotation.

5. Swagger URL

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

6. Source Code

Project Structure

img not found

pom.xml

Main class

Controller class

Bean class

OpenApiConfig.java

Student.java