Fork me on GitHub

OpenAPI / Swagger Tutorial

This tutorial demonstrates using OpenAPI / Swagger to document available REST end points.

The example application for this tutorial has the following configuration:

SwaggerHttpServer configuration.

Tutorial Source

Configuring OpenAPI / Swagger

To configure OpenAPI / Swagger into an application, add the following to pom.xml

		<dependency>
			<groupId>net.officefloor.web</groupId>
			<artifactId>officeweb_openapi</artifactId>
		</dependency>

This is all that is necessary.

Once added the Swagger becomes available:

SwaggerHttpServer swagger.

Customising OpenAPI

The defaults are generally adequate to document most applications. However, if more control is required, the OpenApiOperationExtensionServiceFactory provides means to customise the OpenAPI.

Next

The next tutorial covers CORS.