{
  "schema": "leumas.docs.page/1",
  "id": "adapter:domain/openapi-toolkit",
  "slug": "adapters/domain/openapi-toolkit",
  "kind": "capabilities",
  "bucket": "package",
  "title": "openapi-toolkit",
  "name": "Openapi Toolkit",
  "eyebrow": null,
  "chip": null,
  "summary": "OpenAPI / Swagger REST API specification capability pack for backend developers, API designers and integrators: validate an OpenAPI 3 / Swagger spec (validate) and get a structured list of errors and...",
  "keywords": [
    "openapi-toolkit",
    "swagger",
    "designers",
    "integrators",
    "operationids",
    "openapi toolkit api",
    "listendpoints",
    "examplerequest"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# openapi-toolkit\n\nOpenAPI 3 / Swagger spec intelligence pack for API designers and integrators. Parses a spec from an\nobject, a JSON string, or a YAML-ish string (built-in heuristic parser — no deps), then validates,\ndiffs, lists, exemplifies, documents or builds specs. Deterministic cores; `toMarkdown` has an optional\nAI overview layer that falls back silently when no model is reachable.\n\n## Tools\n\n| Tool | Args | Does |\n|---|---|---|\n| `validate` | `{spec, options?}` | Structured `{valid, errors, warnings}` — missing version/info/paths/responses, dup operationIds, dangling `$ref`. `options.strict` adds style warnings. |\n| `diff` | `{specA, specB}` (aliases `from`/`to`, `old`/`new`, `a`/`b`) | Added / removed / changed operations + a `breaking` list (removed ops, removed params/responses). |\n| `listEndpoints` | `{spec}` | Every operation: method, path, operationId, summary, tags, params, responses. |\n| `exampleRequest` | `{spec, method?, path?, operationId?, options?}` | A runnable `curl` + sample JSON body synthesized from the operation's schema. `options.baseUrl` overrides the server URL. |\n| `toMarkdown` | `{spec, options?}` | Markdown API reference grouped by tag. `options.describe` adds an AI overview when a model is up. |\n| `buildSpec` | `{endpoints:[{method,path,summary?,tags?,body?,responses?}], info?, options?}` | A minimal valid OpenAPI 3 spec (object + pretty JSON) from a compact endpoint list; infers path params and a body schema. |\n\n## Example\n\n```js\nimport pack from './index.js';\nconst { spec } = pack.adapters.buildSpec({\n  endpoints: [{ method: 'post', path: '/users', summary: 'Create user', body: { name: 'string', age: 0 } },\n              { method: 'get', path: '/users/{id}', summary: 'Get user' }],\n  info: { title: 'Users API', version: '1.0.0' },\n});\npack.adapters.validate({ spec });                 // { valid: true, counts:{…} }\npack.adapters.exampleRequest({ spec, method: 'post', path: '/users' }); // { curl:\"curl -X POST …\", body:{…} }\n```\n\n## DRY boundaries\n\n- **`schema`** owns JSON-Schema *shapes* (validate/generate a schema for a data object). This pack works\n  at the whole-API / route level — paths, operations, versions, curl examples, API reference. It reuses\n  the JSON-Schema *concept* to synthesize example bodies but never imports `schema`.\n- Self-contained: only cross-pack import is `../_shared/llm.js`.\n\n## Hybrid intelligence\n\nAll parsing/validation/diff/build cores run offline. Only `toMarkdown` (`options.describe:true`)\nreaches for an LLM to add a prose overview; with no model it returns the reference doc with\n`mode:'heuristic'`. A down model never throws.\n",
  "source": {
    "path": "shared/engines/adapters/domain/openapi-toolkit/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 2869,
    "hash": "2e69ca02bb158e49cccbccadc6b30e5063b795a1"
  },
  "urls": {
    "html": "/p/adapters/domain/openapi-toolkit",
    "json": "/docs/adapters/domain/openapi-toolkit.json",
    "md": "/docs/adapters/domain/openapi-toolkit.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
