
Openapi To Typescript
This converts OpenAPI 3.0 specs into TypeScript interfaces and runtime type guards, handling the full range of schema types including oneOf unions, allOf intersections, and nested references. It extracts types from both component schemas and endpoint definitions, generating request/response interfaces with proper naming conventions. The type guards it produces actually check required fields and primitives at runtime, which is useful if you're validating API responses in production code. It maps format hints like uuid and date-time to string with comments rather than trying to get fancy with branded types. Saves you from hand-writing boilerplate when working with typed API clients.
- skills.sh installs
- 4K
- GitHub stars
- 2.7K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add softaworks/agent-toolkit --skill openapi-to-typescript --agent claude-codeInstalls into .claude/skills of the current project.
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 |
Sponsors
Details
- Repository
- github.com/softaworks/agent-toolkit
- Categories
- Backend & APIs, AI & Agent Building
More from softaworks/agent-toolkit
All 43- Feedback Mastery4K
- Difficult Workplace Conversations4K
- Domain Name Brainstormer4K
- Daily Meeting Update4K
- Game Changing Features4K
- Plugin Forge4K
- Naming Analyzer3.9K
- Lesson Learned3K
- Gepetto1.6K
- Requirements Clarity1K
- Jira854
- Draw Io838
- Mui824
- Design System Starter823
- Backend To Frontend Handoff Docs821
- Frontend To Backend Requirements820
- Excalidraw815
- Perplexity802
- Web To Markdown780
- Datadog Cli738
- Mermaid Diagrams5.2K
- Humanizer4.5K
- Database Schema Designer4.4K
- Qa Test Planner4.4K