How to use OpenAPI-defined services
Open Workflow defines call: openapi. Lemline registers such a definition, but it has no OpenAPI executor yet: an instance faults at the OpenAPI task with Unknown task type: CallOpenAPI. Until it does, call the operation with an HTTP task, as shown at the end of this page. See Supported Features.
Prepare the example
Complete the SQLite setup and keep its worker running. Start the tutorial shop from the root of the Lemline source checkout; it publishes an OpenAPI document of its catalog at http://127.0.0.1:8787/openapi.json. Run the other commands from a second terminal in the setup directory. With the JAR, substitute java -jar lemline.jar for bin/lemline.
Choose an operation
Set with.document.endpoint to the OpenAPI document, select an operation using operationId, and pass its parameters in parameters.
Save it as basic-openapi-call.yaml:
The definition registers. The instance faults with a runtime error titled Unknown task type: CallOpenAPI.
Call the same operation over HTTP
The listProducts operation is GET /products with a category query parameter. This HTTP task sends the same request:
Save it as alternative.yaml:
The instance completes with the first page of garden products: items lists SKU-1, SKU-2 and SKU-3, and hasMore is false. Stop the shop when you are done:
See the OpenAPI Task for configuration options.