docslothregistry

openapi-operation

Static OpenAPI operation reference

pure 1.0.0 Apache-2.0

Install

docsloth component add @docsloth/openapi-operation@1.0.0 \
  --registry https://registry.docsloth.dev

Run it in a project that has a docsloth.config.json (docsloth init writes one). The docsloth CLI is not on npm yet: it runs from a checkout of the Docsloth engine, and the quickstart shows the setup. Every official component already renders in Docsloth sites; installing one vendors its props schema and specification and pins this exact version and digest.

What the CLI checks

docsloth component add reads this entry from index.json, recomputes the package digest from the manifest and the digest of every file, and writes nothing if one differs.

index.json, lines 637–654
637    {638      "name": "@docsloth/openapi-operation",639      "version": "1.0.0",640      "kind": "block",641      "description": "Static OpenAPI operation reference",642      "license": "Apache-2.0",643      "engine": ">=1 <2",644      "publisher": "docsloth",645      "digest": "sha256:0d07bbe12d9741605cc6552c81ff01c845a98de7aaec18b91aa912e1728ec559",646      "blocks": [647        "openapi-operation"648      ],649      "capabilities": [650        "render.html"651      ],652      "manifest_path": "packages/@docsloth/openapi-operation/1.0.0/manifest.json",653      "files_base": "packages/@docsloth/openapi-operation/1.0.0/files"654    },

Trust signals

Runtime trust class (catalog)
pure. Renders content only: no side effects, no network access and no permission prompts.
Install trust class
interactive, derived from the declared render.html. This is the class docsloth component add and docsloth component list report; it installs under the default policy, with no trust policy.
Package
@docsloth/openapi-operation, version 1.0.0
Package digest
sha256:0d07bbe12d9741605cc6552c81ff01c845a98de7aaec18b91aa912e1728ec559
Files
2 files, each pinned by its own sha256 digest (listed under Package files)
Capabilities declared
render.html. A declaration, never a grant; every official package declares the same.
Publisher
docsloth, a publisher id rather than a verified identity
Licence
Apache-2.0
Engine range
>=1 <2
Index signature
Not signed. Digests prove the bytes match the index, not who published them.
Tools
none
Built from
packages/contracts/component-props/openapi-operation.schema.json and packages/contracts/component-specs/openapi-operation.md in docsloth-registry

Props

The props schema is packages/contracts/component-props/openapi-operation.schema.json; props it does not list are rejected.

PropTypeRequiredNotes
operationIdstringyesmaxLength: 200
methodstringyesmaxLength: 32; pattern: ^[A-Za-z][A-Za-z0-9-]*$
pathstringyesmaxLength: 500
summarystringyesmaxLength: 500
parametersarray<object>no
responsesarray<object>no

Required: operationId, method, path, summary.

Example props generated from the schema
{
  "operationId": "getPet",
  "method": "GET",
  "path": "/v1/pets",
  "summary": "Retrieve a pet",
  "parameters": [
    {
      "name": "limit",
      "in": "query",
      "required": true,
      "description": "Max items",
      "example": 10
    }
  ],
  "responses": [
    {
      "status": 200,
      "description": "A pet"
    }
  ]
}

Preview

Rendered by @docsloth/renderer from the example document block in the specification.

Document block
{
  "type": "openapi-operation",
  "props": {
    "operationId": "getPet",
    "method": "GET",
    "path": "/pets/{petId}",
    "summary": "Retrieve a pet",
    "parameters": [
      {
        "name": "petId",
        "in": "path",
        "required": true,
        "description": "Pet id",
        "example": "42"
      }
    ],
    "responses": [
      {
        "status": 200,
        "description": "A pet"
      },
      {
        "status": 404,
        "description": "Not found"
      }
    ]
  }
}

GET /pets/{petId}

Retrieve a pet

nameinrequireddescriptionexample
petIdpathyesPet id42
statusdescription
200A pet
404Not found
GET /pets/{petId}

This is the renderer's real HTML with this registry's styles. Links and controls in the preview are inactive.

Rendered HTML
<section class="ds-operation" data-component="openapi-operation" data-operation-id="getPet" aria-label="GET /pets/{petId} operation">
<p class="ds-operation-signature">
<span class="ds-method" data-method="GET">GET</span>
<code class="ds-operation-path">/pets/{petId}</code>
</p>
<p class="ds-operation-summary">Retrieve a pet</p>
<table class="ds-operation-params">
<thead>
<tr>
<th>name</th>
<th>in</th>
<th>required</th>
<th>description</th>
<th>example</th>
</tr>
</thead>
<tbody>
<tr>
<td>petId</td>
<td>path</td>
<td>yes</td>
<td>Pet id</td>
<td>42</td>
</tr>
</tbody>
</table>
<table class="ds-operation-responses">
<thead>
<tr>
<th>status</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>A pet</td>
</tr>
<tr>
<td>404</td>
<td>Not found</td>
</tr>
</tbody>
</table>
<pre class="ds-operation-example" aria-label="Example request">
<code>GET /pets/{petId}</code>
</pre>
</section>

Specification

From packages/contracts/component-specs/openapi-operation.md.

Contract

Packaged: this block ships as @docsloth/openapi-operation@1.0.0 — an installable component package (kind block, capability render.html, Apache-2.0) whose production props schema is packages/contracts/component-props/openapi-operation.schema.json and whose catalog entry is in packages/contracts/component-catalog.json. No protocol manifest fixture is published (manifest_fixture: null): the fixture models a packaged protocol runtime this block does not have.

Intended behavior

Render one static OpenAPI operation — the counterpart the core can generate from a spec — as a readable card: method badge, path, summary, parameter table and response table. Because it is props-driven it needs no network, spec fetch or schema resolution at render time, and the Markdown twin carries the same tables plus an http example so agents can reconstruct the operation without parsing HTML.

Failure and fallback

A missing operationId/summary/method/path, a non-array parameters/responses, a parameter without a name or a response without a status degrades the block to the labelled fallback. An operation with no parameters or responses is valid and simply omits those tables. Unknown extra props are ignored.

Required acceptance cases

Rendering the same operation twice must produce identical output (no clock, no random ids, no fetches), and the Markdown twin must name every parameter and response the HTML shows. Also test empty data, loading, denied access, browser without JS, mobile 360px, keyboard navigation, dark mode and an explicit constrained agent tool call. The server independently authorizes capability requests; a package manifest cannot grant authority.

Data and maintenance

Data bindings resolve from a specific publication/release vector and permitted fact/evidence graph. Configuration edits create versioned component patches. Update invalidation uses dependency IDs, never indiscriminate whole-page regeneration. Human-owned props survive automatic updates unless invalidated with an explicit conflict. Missing optional resources leave an honest inert/readable fallback, not a broken page or fake success.

Cost and tools

Pure/local interaction must never invoke a model by accident. Any model, remote query or executor call must reserve approved budget before dispatch. Public visitors do not inherit owner resources. The component may call only named tools in its signed manifest with valid typed inputs. A cancelled job stops polling and closes resources. No component gets platform administration, raw credentials or an unlimited execution loop.

Native renderer block

packages/renderer renders an openapi-operation block as a <section data-operation-id="…"> with a method badge (data-method), the path, the summary, a parameters table (name, in, required, description, example), a responses table (status, description) and an example request line. Markdown emits the same signature, summary and tables, then the same request as a fenced http example. All content is static and escaped; nothing is fetched or executed.

Native block props

proptyperequiredbehaviour
operationIdstringyesWritten to data-operation-id for host anchor/navigation use; empty values degrade to the fallback.
methodstringyesHTTP method token, normalised to upper case and shown as a badge.
pathstringyesOperation path; a missing leading / is added. Invalid characters degrade to the fallback.
summarystringyesVisible one-line description of the operation.
parameters{name, in, required?, description?, example?}[]noParameter table rows; wrong shape degrades to the fallback.
responses{status, description?}[]noResponse table rows; wrong shape or a row without a status degrades to the fallback.

Example

{
  "type": "openapi-operation",
  "props": {
    "operationId": "getPet",
    "method": "GET",
    "path": "/pets/{petId}",
    "summary": "Retrieve a pet",
    "parameters": [{ "name": "petId", "in": "path", "required": true, "description": "Pet id", "example": "42" }],
    "responses": [{ "status": 200, "description": "A pet" }, { "status": 404, "description": "Not found" }]
  }
}

Package files

Served under packages/@docsloth/openapi-operation/1.0.0/. The package digest covers manifest.json, which lists each file with its digest.

Filesha256 digestBytes
props.schema.jsonsha256:f05714b56b336505f73132cdfb6d751ef72b50f0e4c42cb7db0bbf8a4904d6932731
spec.mdsha256:87f27043120dc3fdebf3d4e98106c4484c2e785d7666789103edb47e1af87ff84356

Sources

SourceLocation
Markdown twinhttps://registry.docsloth.dev/docs/openapi-operation.md
JSON metadatahttps://registry.docsloth.dev/api/v1/components/openapi-operation.json
Specificationpackages/contracts/component-specs/openapi-operation.md
Props schemapackages/contracts/component-props/openapi-operation.schema.json
Catalogpackages/contracts/component-catalog.json