RESTHost - Documentation generation
The SimpleRESTHost and RESTHost services include functionality that involves automatically generating the API documentation of the service.
In order to generate the documentation when the service is active, select the type of API documentation from the service Properties in the Linx Designer:
- None: No documentation will be generated
- Swagger: Documentation will be generated with Swagger UI
- Redocly: Documentation will be generated with Redocly
Once the service is deployed and activated, navigate to:
For example, if my Base URI is configured to
This then allows external users to view the possibilites of the web service.
If you are still developing your web service, you are also able to generate the API documentation locally using service debugging by setting your Base URI to
To access the API Documentation locally, the service is debugged then the below URL is navigated to:
Generating an API Definition
You are also able to access the actual API definition of the web service which can then be used to:
- Convert a SimpleRESTHost into a RESTHost by importing the the Open API Definition as the API Definition property.
- Import the definition into another Solution
- Use the definition externally
To download the API definition, navigate to the below URL:
Alternatively, click on the below relevant options:
This will then generate the Open API Definition like below:
You can then copy this JSON structure out and import it as the API Definition of the RESTHost service.
Other guides for hosting a REST API
Before and After operation events
Sample solution: CRUD and file operations
View our sample solution on GitHub.