validating-api-schemas
/validating-api-schemas
Validate API schemas against OpenAPI, JSON Schema, and GraphQL specifications. Use when validating API schemas and contracts. Trigger with phrases like "validate API schema", "check OpenAPI spec", or "verify schema".
- Author
- jeremylongshore ↗
- Repository
- tons-of-skills-marketplace ↗
- Licence
- MIT
- Last repository change
- 26.10.2026
Assessment and security
- Files in this package
- 5
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 4
No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/validate-schema.sh
What it does and when to use it
Validate API schemas against OpenAPI, JSON Schema, and GraphQL specifications. Use when validating API schemas and contracts. Trigger with phrases like "validate API schema", "check OpenAPI spec", or "verify schema".
Triggers from the description
Original author description
Validate API schemas against OpenAPI, JSON Schema, and GraphQL specifications. Use when validating API schemas and contracts. Trigger with phrases like "validate API schema", "check OpenAPI spec", or "verify schema".
How it works
- Overview
- Prerequisites
- Instructions
- Output
- Error Handling
- Examples
- Resources
SKILL.md preview
---
name: validating-api-schemas
description: 'Validate API schemas against OpenAPI, JSON Schema, and GraphQL specifications.
Use when validating API schemas and contracts.
Trigger with phrases like "validate API schema", "check OpenAPI spec", or "verify
schema".
'
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(api:schema-*)
version: 1.25.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
license: MIT
tags:
- api
- graphql
- validating-api
compatibility: Designed for Claude Code
---
# Validating API Schemas
## Overview
Validate API specifications against OpenAPI 3.0/3.1, JSON Schema Draft 2020-12, and GraphQL SDL standards using linting rules, structural analysis, and best-practice enforcement. Detect incomplete schemas, undocumented endpoints, inconsistent naming conventions, and breaking changes before they reach consumers.
## Prerequisites
- OpenAPI specification files (YAML or JSON) or GraphQL SDL schema files
- Schema linting tool: Spectral (OpenAPI), `graphql-schema-linter` (GraphQL), or `ajv-cli` (JSON Schema)
- Version control for schema files to enable diff-based breaking change detection
- CI pipeline for automated schema validation on every pull request
- `oasdiff` or `openapi-diff` for breaking change detection between versions
## Instructions
1. Locate all API specification files using Glob, identifying OpenAPI specs, JSON Schema definitions, and GraphQL SDL files across the project.
2. Run structural validation to verify the specification conforms to the declared standard (OpenAPI 3.0, 3.1, or JSON Schema Draft 2020-12) and is syntactically valid.
3. Apply Spectral linting rules to enforce naming conventions (camelCase properties, kebab-case paths), required descriptions on all operations, and example values for request/response schemas.
4. Verify schema completeness: every endpoint has documented request schemas, all response status codes have schemas (including 400, 401, 404, 500), and all `$ref` references resolve.
5. Check for security scheme coverage: every endpoint either declares a security requirement or is explicitly marked as public with rationale.
6. Detect breaking changes by comparing the current schema against the previous released version: removed endpoints, removed required fields, type changes, and narrowed enum values.
7. Validate consistency across endpoints: pagination parameters use the same naming (`page`/`limit` vs `offset`/`count`), error response envelopes follow a single standard, and date formats are consistent.
8. Generate a validation report with severity levels (error, warning, info) and specific file:line references for each finding.
See [`references/implementation.md`](references/implementation.md) for the full implementation guide.
## Output
- `${CLAUDE_SKILL_DIR}/reports/schema-validation.json` - Machine-readable validation findings with severity
- `${CLAUDE_SKILL_DIR}/reports/schema-validation.md` - Human-readable report with fix recommendations
- `${CLAUDE_SKILL_DIR}/reports/breaking-changes.md` - Breaking change analysis between schema versions
- `${CLAUDE_SKILL_DIR}/.spectral.yaml` - Custom Spectral linting rule configuration
- `${CLAUDE_SKILL_DIR}/scripts/validate-schema.sh` - CI-ready schema validation script
- `${CLAUDE_SKILL_DIR}/reports/schema-coverage.md` - Endpoint documentation completeness matrix
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Unresolved $ref | Schema references a component that does not exist or has a typo | List all `$ref` targets and verify each resolves; check for circular references |
| Missing response schema | Endpoint returns undocumented status codes | Add schemas for all observed response codes; use `default` response as fallback |
| Inconsistent naming | Mix of camelCase and snake_case property names across endpoints | Define naming convention in Spectral ruleset; apply auto-fix where possible |
| Breaking change detected | Required field added to existing request schema | Make new field optional with default value; or create new API version for breaking changes |
| Schema too permissive | Use of `additionalProperties: true` or missing type constraints | Set `additionalProperties: false` by default; require explicit type and format on all properties |
Refer to [`references/errors.md`](references/errors.md) for comprehensive error patterns.
## Examples
**Pre-commit schema lint**: Git pre-commit hook runs Spectral against all modified OpenAPI files, blocking commits that introduce undocumented endpoints, missing descriptions, or inconsistent naming.
**Breaking change CI gate**: On pull requests modifying API specs, `oasdiff` compares against the main branch version, failing the build if backward-incompatible changes are detected without a version bump.
**Schema completeness audit**: Generate a matrix showing every endpoint vs. documentation status (description, request schema, response schemas for 200/400/401/404/500, examples), highlighting gaps with coverage percentage.
See [`references/examples.md`](references/examples.md) for additional examples.
## Resources
- Spectral OpenAPI linter: https://stoplight.io/open-source/spectral
- OpenAPI Specification: https://spec.openapis.org/oas/v3.1.0
- JSON Schema specification: https://json-schema.org/
- oasdiff breaking change detection: https://github.com/Tufin/oasdiff
Files in this package (5)
- SKILL.md 5 KB
- references/errors.md 1 KB
- references/examples.md 5 KB
- references/implementation.md 2 KB
- scripts/validate-schema.sh 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · jeremylongshore/tons-of-skills-marketplace | 100 | MIT |
| HelixDevelopment/agent | 100 | MIT |
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version 2c850c9b005b (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100schema-design
Design an API schema — OpenAPI spec, GraphQL schema, or gRPC proto for a feature. Use when asked to "design an OpenAPI spec", "write a GraphQL schema", or "define the proto for this". - 100openapi-specification
OpenAPI 3.x specification design, schema patterns, and validation for REST API contracts. Use when creating or maintaining API specifications, generating documentation, or validating API contracts. - 100automating-api-testing
Test automate API endpoint testing including request generation, validation, and comprehensive test coverage for REST and GraphQL APIs. Use when testing API contracts, validating OpenAPI specifications, or ensuring endpoint reliability. Trigger with phrases like "test the API",… - 100automating-api-testing
Test automate API endpoint testing including request generation, validation, and comprehensive test coverage for REST and GraphQL APIs. Use when testing API contracts, validating OpenAPI specifications, or ensuring endpoint reliability. Trigger with phrases like "test the API",… - 100generating-api-contracts
Generate API contracts and OpenAPI specifications from code or design documents. Use when documenting API contracts and specifications. Trigger with phrases like "generate API contract", "create OpenAPI spec", or "document API contract". - 100generating-api-contracts
Generate API contracts and OpenAPI specifications from code or design documents. Use when documenting API contracts and specifications. Trigger with phrases like "generate API contract", "create OpenAPI spec", or "document API contract".