Generate a REST stub file

Use the fglrestful tool to generate a client stub file from a REST service URL or an OpenAPI description file.

The stub file is generated from the OpenAPI description of the RESTful service. You can obtain the description directly from the service URL or use an existing OpenAPI file.

  1. Generate the stub file from the service URL.
    
    fglrestful -o clientStub http://host:port/gas/ws/r/group/xcf/service?openapi.json
    

    The query string ?openapi.json retrieves the OpenAPI description from the running service. The generated file is named clientStub.4gl.

  2. Generate the stub file from an OpenAPI description file.
    
    fglrestful -o clientStub service-spec-file
    

    Use this option when you already have a local OpenAPI file provided by the service developer.

  3. Confirm that the stub file was created.

    The generated clientStub.4gl file contains all the types and functions needed to call the service. Compile and import it into your Genero REST client application. For details, see REST stub file overview.