Modeling Guide

OpenAPI Plain Greeter

The openapi.server operator allows REST services to be exposed from a graph. It can expose the endpoint as a swagger-driven service endpoint or a plain REST service endpoint. This example demonstrates its plain service mode. There is no swagger document associated with this service.

Configure and Run the Graph

Follow the steps below to run the example from the Data Pipeline UI:
  1. Start the graph. This demo service will be started at path /openapi/service/samples/plain_greeter relative to the vflow instance URL.
  2. Open the UI from the wiretap operator so that the request messages are displayed on the browser.
  3. From some REST client, send a GET request to /openapi/service/samples/plain_greeter/v1/ping or a POST request to /openapi/service/samples/plain_greeter/v1/echo with some text content. When using curl, these correspond to:
curl http://{host}:{port}/{path}/openapi/service/samples/plain_greeter/v1/ping

curl -X -d 'some text' POST http://{host}:{port}/{path}/openapi/service/samples/plain_greeter/v1/echo
For example, for a local vflow instance:
$ curl http://localhost:8090/openapi/service/samples/plain_greeter/v1/ping

$ curl http://localhost:8090/openapi/service/samples/plain_greeter/v1/ping

$ curl -X POST -d 'Buenos dias' http://localhost:8090/openapi/service/samples/plain_greeter/v1/echo
{"echo":"Buenos dias"}