What problem does it solve?
Huma provides a cohesive framework to design, implement, and document Go REST APIs by aligning route registration, input validation, error handling (RFC 9457), middleware, security schemes, and OpenAPI generation. It reduces boilerplate and enforces consistent API patterns across services.
Core Features & Use Cases
- OpenAPI generation from Go code: Generates stable API schemas directly from handlers and operation definitions.
- Consistent request handling: Enforces a uniform handler signature, structured inputs, and built-in validation tags for request data.
- Security and middleware support: Integrates per-operation security schemes and reusable middleware for authorization, logging, and resilience.
- Streaming and SSE support: Supports streaming responses and Server-Sent Events with a clear contract.
- Testing and tooling: Includes utilities like humatest for end-to-end testing and RFC-compliant error handling.
Quick Start
Create a new Go REST API project using Huma and annotate routes to generate OpenAPI docs.