Creating OpenAPI 3.0 Documentation (with Swagger UI) in Spring Boot

Photo by Kelly Sikkema on Unsplash
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${spring-doc-openapi.version}</version>
</dependency>
server.servlet.context-path=/api
server.port=8000
OpenAPI Documentation JSON URL => http://localhost:8000/api/v3/api-docs)
Swagger URL => http://localhost:8000/api/swagger-ui/index.html

Annotations

With @Operation, you can define the purpose of your API.

content = @Content(array = @ArraySchema(schema = @Schema(implementation = OrderInfo.class)))
OpenAPI Doc — General Info and Tags
OpenAPI Doc — Paths
OpenAPI Doc — Class Definitions Used in Request/Response
Swagger — General Info and Tags
Swagger — Paths
Swagger — Class Definitions Used in Request/Response

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nil Seri

Nil Seri

777 Followers

I would love to change the world, but they won’t give me the source code | coding 👩🏼‍💻 | coffee ☕️ | jazz 🎷 | anime 🐲 | books 📚 | drawing 🎨