A modern, simple, fast & flexible micro framework for building HTTP REST/RPC APIs in Go backed by OpenAPI 3 and JSON Schema.
Huma is a micro framework for building HTTP REST and RPC APIs in Go. It provides a declarative interface on top of your router of choice, automatically generating OpenAPI 3.1 documentation and JSON Schema from your Go types to ensure documentation never gets out of sync with your implementation.
Go developers building modern HTTP REST or RPC APIs who need automatic OpenAPI generation, input validation, and incremental adoption with existing routers and middleware.
Developers choose Huma for its automatic, always-in-sync OpenAPI and JSON Schema generation, its flexibility to work with existing routers like Chi or the standard library, and its guard rails to prevent common API development mistakes.
Huma REST/HTTP API Framework for Golang with OpenAPI 3.1
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates OpenAPI 3.1 specifications and JSON Schema directly from Go types, ensuring documentation never drifts from implementation, as emphasized in the README's key features.
Works with existing routers like Chi or Go 1.22+ standard library, allowing incremental adoption without rewriting current infrastructure, per the philosophy section.
Provides static typing for parameters and automatic input validation with RFC9457 JSON error responses, reducing common API mistakes through guard rails.
Leverages OpenAPI to integrate with tools like Stoplight Elements for docs, API Sprout for mocks, and SDK generators, expanding development capabilities seamlessly.
As a micro framework, Huma lacks built-in solutions for authentication, database ORM, or WebSockets, requiring additional libraries and integration effort.
Developers accustomed to imperative Go web frameworks may find the declarative interface and type annotations initially complex, adding upfront cognitive overhead.
Requires Go 1.25 or newer, excluding projects on older versions and potentially complicating migration for teams with legacy codebases.
Huma is an open-source alternative to the following products: