A simple, modern, fast & opinionated REST API framework for Golang
- A modern REST API backend framework for Golang developers
- Described by OpenAPI 3 & JSON Schema
- First-class support for middleware, JSON/CBOR, and other features
- Documentation that can’t get out of date
- Guard rails to prevent common mistakes
- High-quality developer tooling
Features included in the Golang REST/GraphQL API Framework:
- HTTP, HTTPS (TLS), and HTTP/2 built-in
- Optional read-only GraphQL interface built-in
- A declarative interface on top of widely used Golang Router Chi
- Operation & model documentation
- Request params (path, query, or header)
- Request body
- Responses (including errors)
- Response headers
- JSON Errors using RFC7807 and
application/problem+json
- Default (optional) middleware
- RFC8631 service description & docs links
- Automatic recovery from panics with traceback & request logging
- Structured logging middleware using Zap
- Automatic handling of
Prefer: return=minimal
from RFC 7240 - OpenTracing for requests and errors
- Per-operation request size limits & timeouts with sane defaults
- Annotated Golang types for input and output modelsGenerates JSON Schema from Golang types
- Automatic input model validation & error handling
- Documentation generation using RapiDoc, ReDoc, or SwaggerUI
- CLI built-in, configured via arguments or environment variablesSet via e.g.
-p 8000
,--port=8000
, orSERVICE_PORT=8000
- Connection timeouts & graceful shutdown built-in
- Content negotiation between server and client
- Conditional requests support, e.g.
If-Match
orIf-Unmodified-Since
header utilities. - Generates OpenAPI JSON for access to a rich ecosystem of tools
- Mocks with API Sprout
- SDKs with OpenAPI Generator
- CLI with Restish
- And plenty more
- Generates JSON Schema for each resource using
describedby
link relation headers as well as optional$schema
properties in returned objects that integrate into editors for validation & completion.
This project was inspired by FastAPI. Look at the benchmarks to see how Huma compares.
Logo & branding designed by Kari Taylor.
There is no ads to display, Please add some