Swagger API Documentation Support
API Documentation in Swagger Format
The Page Model JSON API supports a Swagger API documentation endpoint at /swagger.json by default. For example, if the URI endpoint of the Page Model JSON API is http://localhost:8080/site/resourceapi/, then you can access the Swagger API documentation through http://localhost:8080/site/resourceapi/swagger.json. A Swagger UI web application (as shown in the screenshot below) can be installed and configured for developers to read and try it out through UI.
To install the Swagger UI web application locally, see the example at /api-docs and the configurations in root pom.xml for the cargo.run profile in the TestSuite project.
Customizing Swagger Path Info
If you need to change the Swagger API documentation endpoint path info from /swagger.json to something else, configure pagemodelapi.v09.apiDocPath property in /WEB-INF/hst-config.properties:
# Customizing Swagger Path Info to /my-swagger.json in this example... pagemodelapi.v09.apiDocPath = /my-swagger.json