{
  "markdown": "# SchemGuard\n\n**API Schema Drift Monitor** — detect breaking changes in OpenAPI specs before they break your consumers.\n\n[![npm version](https://img.shields.io/npm/v/schemaguard)](https://www.npmjs.com/package/schemaguard)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n## Why\n\nAPIs break silently. A field gets renamed, an endpoint gets removed, an enum value disappears — and downstream consumers break in production. SchemGuard catches these before deploy.\n\n## Install\n\n```bash\nnpm install -g schemaguard\n```\n\n## Usage\n\n### Diff two specs\n\n```bash\nschemaguard diff old-api.yaml new-api.yaml\n```\n\nOutput:\n```\nFound 11 change(s):\n\n❌ BREAKING CHANGES (9):\n──────────────────────────────────────────────────\n  ⛔ [endpoint-removed]\n     Endpoint removed: DELETE /pets/{petId}\n     at: DELETE /pets/{petId}\n\n  ⛔ [field-type-changed]\n     Parameter type changed: petId (string → integer)\n     at: GET /pets/{petId} > param petId\n  ...\n\n🚨 9 breaking change(s) detected — deployment blocked.\n```\n\n### CI mode\n\n```bash\nschemaguard ci --spec ./openapi.yaml --baseline ./main-openapi.yaml\n```\n\n- Exit `0` = no breaking changes, safe to deploy\n- Exit `1` = breaking changes detected, blocks the pipeline\n- Exit `2` = error (invalid spec, file not found)\n\n### Lint a spec\n\n```bash\nschemaguard lint ./openapi.yaml\n```\n\nChecks for missing `operationId`, missing descriptions, no security schemes, etc.\n\n### JSON output\n\n```bash\nschemaguard diff old.yaml new.yaml --format json\n```\n\nReturns structured JSON for programmatic consumption by agents and CI tools.\n\n## What it detects\n\n### Breaking changes (exit code 1)\n| Rule | Description |\n|------|-------------|\n| `endpoint-removed` | An endpoint was deleted |\n| `method-removed` | An HTTP method was removed from a path |\n| `required-param-added` | A new required parameter was added |\n| `param-removed` | An existing parameter was removed |\n| `request-field-made-required` | A request field became required |\n| `field-type-changed` | A field's type was changed |\n| `response-field-removed` | A response field was removed |\n| `enum-value-removed` | An enum value was narrowed |\n| `auth-requirement-changed` | Security schemes were modified |\n| `response-code-removed` | A response status code was removed |\n\n### Non-breaking changes (info only)\n| Rule | Description |\n|------|-------------|\n| `endpoint-added` | A new endpoint was added |\n| `optional-param-added` | A new optional parameter was added |\n| `response-field-added` | A new response field was added |\n| `enum-value-added` | An enum value was widened |\n| `description-changed` | Description or summary text changed |\n| `deprecated` | An endpoint was marked as deprecated |\n\n## GitHub Actions\n\n```yaml\n- name: Check API compatibility\n  run: npx schemaguard ci --spec ./openapi.yaml --baseline ./baseline.yaml\n```\n\n## Programmatic API\n\n```typescript\nimport { parseSpec, diffSpecs, formatDiff } from 'schemaguard';\n\nconst oldSpec = parseSpec('./v1.yaml');\nconst newSpec = parseSpec('./v2.yaml');\nconst result = diffSpecs(oldSpec, newSpec);\n\nif (result.hasBreakingChanges) {\n  console.log(`${result.breaking.length} breaking changes found`);\n}\n```\n\n## License\n\nMIT\n",
  "bytes": 3192,
  "sha": "be5af731511af21fd5aff19d1a8b4a92d8634222db4eda27052b8ac3c7e888d3",
  "repo_slug": "sethclawd-prog/schemaguard",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_sethclawd_prog_schemaguard_2a904a11/readme"
}