Provide service information
Provide information about the service, such as title, version, contact details, etc., that is generated in the OpenAPI specification file.
In your service module:
- Define a
PUBLIC
record with aWSInfo
attribute. This record allows you to provide metadata about your REST service, which can be generated according to the OpenAPI standard and used by clients. This example record follows that OpenAPI specification:# service module PUBLIC DEFINE serviceInfo RECORD ATTRIBUTE(WSInfo) title STRING, description STRING, termOfService STRING, contact RECORD name STRING, url STRING, email STRING END RECORD, version STRING END RECORD = ( title: "my service", version: "1.0", contact: ( email:"helpdesk@mysite.com") ) # ... service functions ...
Note: If you do not set a service information record, the default value as the name of the service module is used for the service title. - Add record fields as required. The GWS does not check the record structure used with
WSInfo
attribute. You are therefore allowed to add the fields you want to be available in the OpenAPI specification. - Add values for the record fields.
The information provided is then generated in the openapi.json or openapi.yaml specification file.