Skip to content
Back to skills

Openapi Contracts

ASecurity

Maintain OpenAPI 3.1 contracts cleanly: schema single source of truth, linting, breaking-change checks and codegen

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentgogitapibackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill openapi-contracts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openapi Contracts?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openapi Contracts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-openapi-contracts/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-openapi-contracts)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Maintain OpenAPI 3.1 contracts cleanly: schema single source of truth, linting, breaking-change checks and codegen
profile: standard
tags: openapi, api, contracts, backend
---

# OpenAPI contracts

Use when writing or updating `openapi.yaml`/`openapi.json` specs, generated API clients, or contract tests.

## Contract hygiene
- Keep OpenAPI specs as the single source of truth (either spec-first with generated server stubs/types, or schema-derived from server Zod/Pydantic models checked into git—never maintain disconnected hand-edited docs alongside code).
- Use explicit `$ref` components under `components.schemas`, `components.responses`, and `components.securitySchemes` (`bearerAuth` / `oauth2`) instead of duplicating inline object shapes everywhere.
- Document every error response (`400`, `401`, `403`, `404`, `429`) with a shared error envelope (`ProblemDetails` / `{ code, message, requestId }`) and concrete schema constraints (`format`, `minLength`, `enum`, `additionalProperties`).

## Compatibility and tooling
- Treat removing endpoints, renaming fields, tightening request constraints, adding required request fields, or removing enum values as **breaking changes** requiring version negotiation or expand-contract rollout.
- Generate typed client SDKs cleanly in CI and commit or publish build artifacts deterministically with pinned generator versions.

## Verify
Run OpenAPI validation and linting (`spectral lint` / `redocly lint`), breaking-change diff against `main` (`oasdiff breaking`), and contract tests validating live server responses against the spec.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.