Recipes
How to pick operations is on the overview; these are common ways to put them on a page.
<rapi-doc-mini spec-url="/specs/reqres.yaml" filter-operations="GET /users/{userId} POST /users" schema-style="table"></rapi-doc-mini><rapi-doc-mini spec-url="/specs/reqres.yaml" filter-operations="POST /users" paths-expanded="true" layout="column"></rapi-doc-mini>Each element loads its own OpenAPI spec, so one page can walk through a flow that spans services:
<rapi-doc-mini spec-url="https://api.example.com/auth/openapi.yaml" filter-operations="POST /oauth/token"></rapi-doc-mini><rapi-doc-mini spec-url="https://api.example.com/billing/openapi.yaml" filter-operations="POST /charges"></rapi-doc-mini>The key is sent with every Try request when all three api-key-* attributes are set:
<rapi-doc-mini spec-url="/specs/api.yaml" filter-operations="GET /orders" api-key-name="X-API-Key" api-key-location="header" api-key-value="test-key-123"></rapi-doc-mini>If the spec can’t be loaded, the element renders nothing and logs the error to the browser console.
Show an operation from a script
Section titled “Show an operation from a script”showOperation(operation) expands one operation and scrolls it into view. Pass its operationId or its method and path; it resolves to false when the element does not show that operation (the spec is not loaded yet, or filter-operations leaves it out).
await document.querySelector('rapi-doc-mini').showOperation('GET /pet/{petId}');Next to a workflow
Section titled “Next to a workflow”<rapi-flow> pairs with one <rapi-doc-mini> per API its Arazzo workflow calls. Name the API with arazzo-source; <rapi-flow> then sets the mini’s filter-operations to the workflow’s calls to that API, in step order, and clicking a step shows its operation in the mini.
<rapi-flow arazzo-url="/workflows/ship-a-parcel.arazzo.yaml" for="rates-api shipments-api"></rapi-flow><rapi-doc-mini id="rates-api" arazzo-source="rates" spec-url="/specs/rates.yaml"></rapi-doc-mini><rapi-doc-mini id="shipments-api" arazzo-source="shipments" spec-url="/specs/shipments.yaml"></rapi-doc-mini>