I.What is OpenAPI
OpenAPI Specification (formerly Swagger Specification) is an API description format for REST APIs. An OpenAPI file allows you to describe your entire API, including:
- Available endpoints (/users) and operations on each endpoint (GET /users, POST /users)
- Operation parameters Input and output for each operation
- Authentication methods
API specifications can be written in YAML or JSON. The format is easy to learn and readable to both humans and machines. The complete OpenAPI Specification can be found on GitHub: OpenAPI 3.0 Specification
You can find out more information about OpenAPI from here
What dependency we need to add to POM file
We also need to add some annotation to the controller api file
That’s it. Run the maven spring-boot project to see what happens
You can navigate to the default url in your browser to check the documentation.
The full source code can be found in github from here.
Happy coding ~~