openapi-schemas

Enforce OpenAPI schema rules 14-24 for consistent API specifications.

6|Updated Feb 20, 2025
One-click install
npx skills add https://github.com/zerobias-org/module --skill openapi-schemas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openapi-schemas
Source: https://github.com/zerobias-org/module/tree/main/.claude/skills/openapi-schemas
Command: npx skills add https://github.com/zerobias-org/module --skill openapi-schemas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

OpenAPI schema design often drifts from core rules, leading to inconsistent response mappings, inline objects, and duplicated definitions. This Skill codifies rules 14-24 to ensure stable, reusable schemas across APIs.

Core Features & Use Cases

  • Direct main object mapping: ensure responses reference main business objects via $ref.
  • Context separation: split summary and full schemas to optimize nested vs direct responses.
  • Nested object discipline: enforce all nested objects use $ref for maintainability.
  • Rule-driven validation: enforce string IDs, no nullable fields, and clean resource paths.
  • Use Case: For example, design a User schema with a summary and full version using allOf to illustrate composition.

Quick Start

Define a User schema with both a summary and a full version using allOf to compose properties.

Frequently Asked Questions about openapi-schemas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent OpenAPI schema design across multiple API specifications?

OpenAPI schema design consistency is enforced by codifying rules 14-24, which mandate direct main-object mapping via $ref, string IDs, no nullable fields, and proper nested references across API suites to prevent schema drift and duplicated definitions.

How do I separate summary and full schemas in OpenAPI to optimize nested vs direct responses?

Summary and full schemas in OpenAPI are separated by splitting definitions and using allOf composition, allowing direct responses to reference lightweight summary objects while nested responses resolve into full, detailed business objects.

Why should I use $ref for nested objects in OpenAPI instead of defining them inline?

Using $ref for nested objects in OpenAPI enforces nested object discipline, ensuring maintainability and reusability by preventing inline object definitions that cause schema duplication and drift across API specifications.

What is the best way to compose OpenAPI schemas using allOf for a base resource like User?

Composing OpenAPI schemas using allOf involves defining a base User schema and extending it into summary and full versions, applying base composition rules to reuse shared properties while avoiding nullable fields and maintaining clean resource paths.

Can I use nullable fields or non-string IDs in my OpenAPI schemas when applying strict validation rules?

No, strict OpenAPI schema validation rules explicitly prohibit nullable fields and require string IDs to maintain clean resource paths and stable response mappings, ensuring consistent API specifications across the suite.

When do I need context separation in my OpenAPI schema definitions?

Context separation in OpenAPI schema definitions is needed when APIs require distinct nested and direct responses, allowing you to optimize payload size by returning summary schemas for lists and full schemas for detailed resource endpoints.