Skip to content

Swagger

Swagger automatically generates a website that documents the REST APIs supported by the OMAG Server Platform. It is based on the Open API Specification (V3).

The website is found at <serverURLroot>/swagger-ui.html. For example if the platform is running at https://localhost:9443, the URL for Swagger is https://localhost:9443/swagger-ui.html

The top of the page gives a general description of the OMAG Server platform plus a link to more documentation.

Swagger UI Heading

The content for this header is located in the OMAGServerPlatform.java file that provides the main() method for the OMAG Server Platform.

It is using Open API annotations that look like this:

Swagger UI Heading Annotation

Beneath the header is a list of the platform's REST APIs. This is the definition for the Operational Services that are part of the Administration Services:

Swagger UI Service

The REST API operations are grouped into services by the following @Tag annotation that appears in each spring resource bean that is part of the service. If the name of the @Tag matches then the operations in the resource beans are all part of the same service.

These are the annotations from OperationalServicesResource.java.

Swagger UI Service Annotation

Further information can be provided for each operation. This is one of the Operational Services operations.

Swagger UI Operation

This is added to the spring resource bean using the @Operation annotation.

Swagger UI Operation


Raise an issue or comment below