Loading...
Loading...
OpenAPI 3.1 specification, schema design, and code generation. Use when designing REST APIs, generating TypeScript clients, or creating API documentation. Use for openapi, swagger, api-spec, schema, code-generation, api-docs, openapi-typescript, zod-openapi.
npx skill4agent add oakoss/agent-skills openapi| Pattern | Element | Key Points |
|---|---|---|
| Document root | | |
| Path item | | Curly braces for path parameters |
| Operation | | Each operation needs |
| Parameters | | Path params are always |
| Request body | | Keyed by media type ( |
| Response | | At least one response required per operation |
| Component ref | | Reuse schemas, parameters, responses |
| Schema types | | Arrays support |
| Composition | | Model polymorphism and intersection types |
| Discriminator | | Hint for code generators with |
| Security | | Bearer, API key, OAuth2, OpenID Connect |
| Tags | | Group operations for documentation |
| Type generation | | Zero-runtime TypeScript types from spec |
| Typed fetch | | Type-safe HTTP client using generated types |
| React Query | | Type-safe React Query hooks from spec |
| Schema-first | | Generate OpenAPI documents from Zod schemas |
| Mistake | Correct Pattern |
|---|---|
Using | Use |
Missing | Always set unique |
Path parameter not in | Path parameters are always required ( |
| Inline schemas everywhere | Extract to |
| Merge |
| Discriminator without shared property | All schemas in |
Empty | Every response needs a meaningful |
Using | Always define |
Circular | Break cycles with lazy resolution or restructure schemas |
| Mixing 3.0 and 3.1 syntax | Choose one version; 3.1 drops |
TaskExplorecode-reviewerIf theskill is available, delegate advanced TypeScript typing questions to it.typescript-patterns