openapi-generator

Generates OpenAPI 3.0/3.1 specifications from Express, Next.js, Fastify, Hono, and NestJS routes.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/zinohome/RTMessage --skill openapi-generator-zinohome
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: openapi-generator
Source: https://github.com/zinohome/RTMessage/tree/main/.github/skills/openapi-generator
Command: npx skills add https://github.com/zinohome/RTMessage --skill openapi-generator-zinohome

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typescript, @babel/parser, @babel/traverse, js-yaml, commander, @apidevtools/swagger-parser, @fastify/swagger, @fastify/swagger-ui, @nestjs/swagger.

What problem does it solve? Writing and maintaining OpenAPI specifications by hand is tedious and error-prone, especially as API routes evolve. This Skill scans your existing API codebase and produces a complete, validated OpenAPI 3.0/3.1 spec automatically. ## Core Features & Use Cases - Route Scanning: Extracts route definitions, JSDoc metadata, and path parameters from Express, Next.js, Fastify, Hono, or NestJS codebases. - Schema Generation: Converts TypeScript types into OpenAPI component schemas, including enums, arrays, and required fields. - Spec Export & Validation: Outputs YAML or JSON specs with security schemes, tags, and examples, then validates them with Swagger Parser. - Use Case: You have an Express API with 40 endpoints and need documentation for a partner team. Run the generator to produce an openapi.yaml file that imports directly into Postman, Insomnia, or Swagger UI. ## Quick Start Ask the AI to generate an OpenAPI 3.1 specification from the routes in your src directory and export it as openapi.yaml.

Frequently Asked Questions about openapi-generator

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

FAQPage Schema
How do I generate an OpenAPI spec from Express routes?▼

Scan your Express source directory to extract route definitions and JSDoc metadata like @summary, @description, and @tags. The generator converts Express-style :param paths to OpenAPI {param} syntax and builds path objects with default responses.

How to convert TypeScript types to OpenAPI schemas?▼

Use the TypeScript compiler API to walk type nodes: primitives map to string, number, or boolean; arrays map to items schemas; object properties become schema properties with required fields derived from optional modifiers. String literal unions become enums.

Does Fastify support automatic OpenAPI documentation?▼

Yes, Fastify integrates with @fastify/swagger and @fastify/swagger-ui to serve OpenAPI specs and interactive docs at a route prefix like /docs. Route schemas defined in Fastify are used directly to build the specification.

Can I generate OpenAPI docs from NestJS controllers?▼

Yes, NestJS uses @nestjs/swagger decorators such as @ApiTags, @ApiOperation, @ApiResponse, and @ApiBody on controllers to produce OpenAPI documentation. DTO classes define request and response schemas.

How do I validate an OpenAPI specification file?▼

Use @apidevtools/swagger-parser to validate the spec file programmatically. It parses the YAML or JSON, checks structural correctness, and reports validation errors before you publish or import the spec.

What are the limitations of route-scanning OpenAPI generation?▼

Scanned specs rely on JSDoc comments and type information, so undocumented routes get generic summaries and default responses. Complex runtime behavior like dynamic middleware-based validation may not be captured without manual annotation.