Skip to content

OpenAPI Overview

Yelix provides built-in support for generating OpenAPI documentation for your APIs. This feature allows you to automatically create and maintain API documentation based on your route definitions.

Install Dependencies
deno add jsr:@yelix/hono jsr:@yelix/zod-validator npm:zod

OpenAPI (formerly Swagger) is a specification for describing RESTful APIs. Yelix automatically generates OpenAPI 3.1 specifications from your route definitions, making it easy to:

  • Document your API automatically as you build it
  • Generate client libraries for your API consumers
  • Test your API using interactive documentation tools
  • Share API specifications with your team

The OpenAPI integration in Yelix includes:

  • Automatic Documentation: Generate OpenAPI specs from your routes
  • Zod Schema Integration: Convert Zod schemas to OpenAPI schemas automatically
  • Request Validation: Validate requests using Zod with automatic schema generation
  • Response Documentation: Document response structures with type safety
  • Security Schemas: Define authentication methods
  • Server Configuration: Configure multiple server environments

To get started with OpenAPI in Yelix:

  1. Getting Started - Initialize your app with OpenAPI
  2. Configuration - Configure servers and security
  3. Documenting Endpoints - Document your API routes
  4. Response Schemas - Define response structures
  5. Examples - See complete working examples