# API Contract Validator

> Compare observed HTTP API requests and responses with an OpenAPI or equivalent endpoint contract. Use when asked to validate a response against an HTTP specification, find API contract drift, check status codes or headers, or review captured request and response evidence. Produce a conformance report without designing general API coverage; use a message-specific validator for AsyncAPI and standalone JSON Schema artifacts.

- Skill: `pramoddutta/api-contract-validator-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add pramoddutta/api-contract-validator-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/pramoddutta/api-contract-validator-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- License: MIT
- Author: PramodDutta (https://skillmd.com/u/pramoddutta)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/pramoddutta/api-contract-validator-2

---


# API Contract Validator

Validate observed API behavior against an identified contract version.

## Inputs and evidence

Require the contract, its version or revision, and a captured request/response or runner
output. Record the method, path, status, media type, and evidence source. Mark missing
material `Not provided`; never synthesize traffic.

## Workflow

1. Resolve the observed exchange to the exact contract operation and response.
2. Check documented status, headers, required fields, types, nullability, enums, formats,
   and additional-property rules.
3. Classify every check as `Conforms`, `Mismatch`, `Ambiguous`, or `Not verifiable`.
4. Cite the contract pointer and minimal redacted evidence for every finding.
5. Separate implementation drift from possible contract staleness; do not choose a source
   of truth without owner confirmation.
6. **HUMAN REVIEW GATE (mandatory).** Ask the API owner to confirm the contract version
   and findings before recommending a specification or implementation change.

## Output shape

| Check | Contract pointer | Observed evidence | Result | Follow-up |
|---|---|---|---|---|

Include the evidence source, contract revision, unresolved ambiguities, and review decision.

## Guardrails

- Treat examples as examples, not schema constraints.
- Never mark an unobserved check as passing or fabricate a response, field, or result.
- Redact tokens, cookies, keys, personal data, and confidential payload values.
- Do not call a live endpoint unless the user confirms authorization, target environment,
  and request scope; default to offline evidence review.

