Springdoc-openapi is a library to automate the generation of OpenAPI documentation in Spring Boot projects.

It provides a set of annotations and configuration options to automatically generate an OpenAPI specification

Springdoc openapi works by examining an application at runtime to infer API semantics based on spring configurations, class structure and various annotations. Automatically generates documentation in JSON/YAML and HTML format APIs. This documentation can be completed by comments using swagger-api annotations.


Add the following dependency to pom.xml file


This will automatically deploy swagger-ui to a spring-boot application

Documentation will be available in HTML format, using the official swagger-ui jars

The Swagger UI page will then be available at

http://server:port/context-path/swagger-ui.html and the OpenAPI description will be available at the following url for json format: http://server:port/context-path/v3/api-docs


In Java add following annotation in class containing main method

		  info = @Info(
		    title = "XXXXX",
		    version = "0.0.1",
		    contact = @Contact(
		      name = "XXXXX XXXXX",
		      email = "XXXXX@XXXXXt.com"

Operations Documentation’s

Using library to document services. On top of methods adds annotation

	@io.swagger.v3.oas.annotations.Operation(summary = "My summary ", description = "Service description ",
			   responses = {
					   	@ApiResponse(responseCode = "200", description = "Describe results", content = @Content(schema = @Schema(implementation = List.class))),
					   	@ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(schema = @Schema(implementation = String.class)))					   	



Spring web page Spring Doc Open Api

Esto es todo