Operation By Method And Path

If you have a file with an https://github.com/OAI/OpenAPI-Specification/blob/master/README.md Open API definition (a.k.a. a Swagger file) you can render it by a given method and path , or by operationId . Both yaml and json formats are supported.Let's consider https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/json/uber.json Uber's API definition as an example: :include-open-api: open-api/uber.json {method: "get", path: "/estimates/time"} Responses 200 default Note: descriptions are treated as Markdown, using the https://commonmark.org/help/ CommonMark specification

Operation By ID

Let's take a pet store example. Use operationId to include operation definition by ID. :include-open-api: petstore-openapi3.json {operationId: "updatePet"} Request Responses 200 400 404 405

Add a new pet to the store

Use the autoSection property to automatically generate a page section with a title taken from an operation summary. :include-open-api: petstore-openapi3.json {operationId: "addPet", autoSection: true} Note: The section below is automatically generated by include-open-api Request Responses 200 405

Time Estimates

Specify tags to automatically generate multiple entries from a service definition file. :include-open-api: open-api/uber.yaml {tags: "Estimates", autoSection: true} Note: The sections below are automatically generated by include-open-api Responses 200 default Responses 200 default

Two Sides Layout

Znai supports layout/two-sides-pages Two Sides Layout mode that is perfect to supplement API documentation with examples column. layout/two-sides-pages#open-api-example Open API example