
Openapi To Typescript
Converts OpenAPI 3.0 specs into TypeScript interfaces, request/response types, and type guards for validation.
- skills.sh installs
- 4K
- GitHub stars
- 2.7K
- last updated
- Aug 21, 2026
What it does
- Covers the full workflow: validate the spec, extract schemas and endpoints, generate types, and write the output file
- Maps primitives, formats, objects, arrays, enums,
oneOfunions, andallOfintersections to TypeScript constructs - Enforces OpenAPI 3.0.x only, reports missing
$reftargets, and stops on invalid specs - Designed for teams generating typed API clients and runtime guards from an existing specification
Install
$ npx -y skills add softaworks/agent-toolkit --skill openapi-to-typescript -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
OpenAPI to TypeScript
Converts OpenAPI 3.0 specifications to TypeScript interfaces and type guards.
Input: OpenAPI file (JSON or YAML) Output: TypeScript file with interfaces and type guards
When to Use
- "generate types from openapi"
- "convert openapi to typescript"
- "create API interfaces"
- "generate types from spec"
Workflow
- Request the OpenAPI file path (if not provided)
- Read and validate the file (must be OpenAPI 3.0.x)
- Extract schemas from
components/schemas - Extract endpoints from
paths(request/response types) - Generate TypeScript (interfaces + type guards)
- Ask where to save (default:
types/api.tsin current directory) - Write the file
OpenAPI Validation
Check before processing:
- Field "openapi" must exist and start with "3.0"
- Field "paths" must exist
- Field "components.schemas" must exist (if there are types)
If invalid, report the error and stop.
Type Mapping
Primitives
| OpenAPI | TypeScript |
|---|---|
string | string |
number | number |
integer | number |
boolean | boolean |
null | null |
Details
- Repository
- github.com/softaworks/agent-toolkit
- Categories
- Backend & APIs, Technical Documentation, Frontend & UI Code
More from softaworks/agent-toolkit
All 40- Feedback Mastery4K
- Difficult Workplace Conversations4K
- Daily Meeting Update4K
- Game Changing Features4K
- Plugin Forge4K
- Naming Analyzer4K
- Lesson Learned3K
- Gepetto1.6K
- Requirements Clarity1K
- Draw Io851
- Design System Starter835
- Backend To Frontend Handoff Docs833
- Frontend To Backend Requirements831
- Excalidraw827
- Perplexity821
- Web To Markdown792
- Datadog Cli747
- Mermaid Diagrams5.3K
- Humanizer4.5K
- Database Schema Designer4.4K
- Qa Test Planner4.4K
- Writing Clearly And Concisely4.4K
- C4 Architecture4.3K
- Skill Judge4.3K
Similar to Openapi To Typescript
More Backend & APIs
openapi-generatorpatricio0312rev/skills319 installsGenerates OpenAPI 3.0/3.1 specs from Express, Next.js, Fastify, Hono, or NestJS routes with schemas and examples.
openapi-spec-generationwshobson/agents17.2K installsStructured OpenAPI 3.1 spec generation, from code or design-first, with validation patterns for API contracts.
orvalorval-labs/orval616 installsType-safe OpenAPI codegen for clients, query hooks, Zod schemas, MSW mocks, Hono handlers, and MCP servers.
openapi-to-application-codegithub/awesome-copilot9.5K installsGenerate a complete, runnable application from an OpenAPI spec, following the target framework's conventions.
api-documenterzhaono1/agent-playbook641 installsSpecialist skill that writes OpenAPI/Swagger specs for REST and GraphQL APIs with endpoint, schema, and auth coverage.
openapi-specification-v2hairyf/skills783 installsReference catalog for writing, validating, and interpreting OpenAPI 2.0 (Swagger) specifications for REST APIs.