5. OpenAPI

openapiPublisher

Version

Serves the OpenAPI documents declared on the enclosing api together with a Swagger UI, under the /api-docs path. /api-docs returns an overview of all documents: an HTML page when the client accepts HTML, otherwise a JSON list with each document's title, version, and links. /api-docs/{id} returns one document as YAML, rewritten so its server URLs point at the gateway, and /api-docs/ui/{id} opens the Swagger UI for that document. An unknown id returns 404; requests to other paths pass through unchanged. Can only be used inside an api. See the examples under examples/openapi and the tutorial tutorials/getting-started/80-OpenAPI.yaml.

Example Configuration

api:
port: 2000
openapi:
- location: fruitshop-api.yml
flow:
- openapiPublisher: {}
api:
   port: 2000
   openapi:
     - location: fruitshop-api.yml
   flow:
     - openapiPublisher: {}

Syntax

openapiPublisher: {}
openapiPublisher: {}

Can be used in