Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Openapi Contracts?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-openapi-contracts)
---
description: Keep an OpenAPI spec as the API contract: generated or validated, linted, and used for clients, mocks and tests
profile: standard
tags: api, openapi, contracts, documentation
---
# OpenAPI contracts
A spec that drifts from the code is worse than none.
## Single source
- Either generate the spec from code (FastAPI, NestJS, springdoc, tsoa) or generate server stubs from the spec — pick one direction.
- Commit the spec; review its diff in PRs.
## Quality
- Lint with Spectral or Redocly: operationIds, descriptions, error schemas, examples.
- Document error responses (4xx/5xx) with a shared error schema, not just 200.
## Use it
- Generate typed clients; validate requests/responses against the spec in tests; run a mock server for frontend work.
## Verify
Spec lint passes, and a contract test validates real responses from the changed endpoints against the spec.