ENFR0.1.0-rc.3

Add your API reference

Generate reference pages, schemas and examples from OpenAPI.


Add your API reference
0:00 / 0:13
  1. Point at the contract

    One path, or an array — each entry becomes its own service.

    specistry.config.ts
    openapi: "./openapi.yaml",
  2. Place it in the sidebar

    Without navigation, pages come first and the API reference follows.

    specistry.config.ts
    navigation: [
      "quickstart",
      { api: true, label: "API reference" },
    ],
  3. Link to it from guides

    API links are checked against the contract at build time.

    docs/quickstart.md
    Create one with [Create inbox](/api/inboxes/create-inbox).
    See the [201 response](/api/inboxes/create-inbox#response-201).

How URLs are formed

  • The reference lives under /api
  • Groups are tags — the group slug is the slugified tag name, in declared tag order
  • Operation slugs are the operationId in kebab case, or method-path without one
  • Collisions gain -2, -3 in canonical order
  • Untagged operations go to an operations group, listed last

TipStable URLs

Set an operationId on every operation. Renaming a path then never changes the documentation URL.

Multiple contracts

specistry.config.ts
openapi: [
  "./contracts/identity.yaml",
  "./contracts/payments.yaml",
],

Contracts are never merged because their paths look alike. Local $refs resolve inside the project; remote references are disabled.

Edge cases

Remote $ref

Remote references disabled
✕ FAILS
openapi.yaml
$ref: "https://schemas.acme.dev/inbox.yaml"
✓ FIX
openapi.yaml
$ref: "./schemas/inbox.yaml"

Builds must be reproducible and offline.

Link to an operation that does not exist

CONTENT_LINK_TARGET_MISSING
✕ FAILS
docs/quickstart.md
[Create](/api/inboxes/create)
✓ FIX
docs/quickstart.md
[Create](/api/inboxes/create-inbox)

The slug comes from operationId `createInbox` → `create-inbox`.

Report an issue with this page on GitHub