Generate service description on demand

You can access a description of your GWS REST Web service through a query string on the URL of the Web service.

The Genero REST Web service allows for the functions defined in your Web service to be generated according to the OpenAPI specification. You can choose to access the description by choosing to output it in either the JSON or YAML format:

http://host:port/gas/ws/r/service-name?openapi.json

Or

http://host:port/gas/ws/r/service-name?openapi.yaml

Note: The GWS service must be running on the specified port in order to provide the Web service information. The GWS server must be behind a GAS in production to handle the load.

The OpenAPI file allows you to see your entire Web service, including:

  • Available resources (paths) and functions, for example, /add, /sub/{f}, /mult/{coef}/hello), etc., and operations (GET, POST, etc.)
  • Parameters, input and output for each function
    Figure: Parameters represented in the OpenAPI specification file


  • Responses, such as error handling specifications, error codes and messages
    Figure: Response codes represented in the OpenAPI specification file


  • Service information, such as title, version, contact, etc.
    Figure: Sample of service information in OpenAPI specification file


Generating the stub file

You can use the fglrestful tool provided by the Genero Web Services package to generate a stub file from the openapi.json file. The stub file is a Genero BDL file with code that will manage calls made by your client application to the Web service. For details, see the Get the RESTful Web service information page.

Testing the GWS service in stand-alone mode

If you are on a local server, you can start the GWS server as shown in Getting started with REST high-level