chanfana-openapi

Generate OpenAPI specs and validate requests for Cloudflare Workers APIs.

3|1|Updated Jun 3, 2025
One-click install
npx skills add https://github.com/Tobbe3108/GoPayShortcuts --skill chanfana-openapi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chanfana-openapi
Source: https://github.com/Tobbe3108/GoPayShortcuts/tree/main/.opencode/skills/chanfana-openapi
Command: npx skills add https://github.com/Tobbe3108/GoPayShortcuts --skill chanfana-openapi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables developers to rapidly build type-safe REST APIs by deriving OpenAPI specifications directly from code using Chanfana, Hono, and Cloudflare Workers, eliminating manual YAML.

Core Features & Use Cases

  • Automatic Swagger/OpenAPI generation from TypeScript route handlers with no separate YAML files.
  • Built-in request validation using Zod and automatic error handling.
  • Seamless edge deployment to Cloudflare Workers with composable middleware and security schemes.
  • Use Case: Kick off a new API project and obtain live API docs, type-safe routes, and validation in minutes.

Quick Start

Install npm dependencies, initialize a Cloudflare Workers project, implement a minimal OpenAPIRoute using a simple schema, and run wrangler dev to view Swagger UI.

Frequently Asked Questions about chanfana-openapi

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

FAQPage Schema
How do I generate OpenAPI Swagger documentation from TypeScript routes without writing manual YAML?

Yes, you can build type-safe REST APIs with automatic Swagger documentation by combining Chanfana and Hono on Cloudflare Workers, generating OpenAPI specs directly from TypeScript route handlers without manual YAML.

How do I set up request validation in Hono APIs deployed on Cloudflare Workers?

You can set up request validation in Hono APIs by integrating Zod schemas within Chanfana's OpenAPIRoute, providing built-in runtime validation and automatic error handling for your Cloudflare Workers endpoints.

Does Chanfana work with Cloudflare Workers for edge deployment?

Yes, Chanfana works seamlessly with Cloudflare Workers for edge deployment, allowing you to run wrangler dev and build composable middleware with security schemes directly at the network edge.

What is the best way to create type-safe REST APIs with auto-generated specs?

The best way to create type-safe REST APIs with auto-generated specs is deriving OpenAPI specifications directly from TypeScript route handlers using Chanfana and Hono, ensuring runtime validation and live Swagger UI.

Do I need separate YAML files when using Chanfana for OpenAPI generation?

No, you do not need separate YAML files when using Chanfana for OpenAPI generation, because it derives the Swagger specifications directly from your TypeScript code and integrated Zod schemas.