Enable OpenAPI Specification Generation
Before enabling the OpenAPI specification, you should have a REST API defined. The RestApi worksheet and RestApiEndpointGroup worksheet should be created. We will pick the Sample REST API as an example for illustration.
Enabling OpenAPI specification generation
Go to the OpenAPI Specification Settings section of the RestApi worksheet. Set the value of Enable OpenAPI Specification Generation as Yes.
Fill in other configurations of the section such as the title, description, contact name, API license and so on.
Go to the OpenAPI Response Code Configuration section. Change the configurations of the response message if required. They will be displayed on the OpenAPI specification.
With the above steps, the OpenAPI specification will be generated along with the API when compiling.
Accessing the specification
Use the Run REST API Jar and Launch OpenAPI button.
Downloading the data file of the specification
AlchemyJ provides a built-in specification UI for presenting the specification data. If you have your own UI, you can download the data file of the specification and put it into your UI. To download the data file, you can click on the hyperlink under the Base URL.