A modern, simple, fast & flexible micro framework for building HTTP REST/RPC APIs in Go backed by OpenAPI 3 and JSON Schema. Pronounced IPA: /‘hjuːmɑ/. The goals of this project are to provide:
- Incremental adoption for teams with existing services
- Bring your own router (including Go 1.22+), middleware, and logging/metrics
- Extensible OpenAPI & JSON Schema layer to document existing routes
- A modern REST or HTTP RPC API backend framework for Go developers
- Described by OpenAPI 3.1 & JSON Schema
- Guard rails to prevent common mistakes
- Documentation that can’t get out of date
- High-quality generated developer tooling
Features include:
- Declarative interface on top of your router of choice:
- Operation & model documentation
- Request params (path, query, header, or cookie)
- Request body
- Responses (including errors)
- Response headers
- JSON Errors using RFC9457 and
application/problem+json
by default (but can be changed) - Per-operation request size limits with sane defaults
- Content negotiation between server and client
- Conditional requests support, e.g.
If-Match
orIf-Unmodified-Since
header utilities. - Optional automatic generation of
PATCH
operations that support: - Annotated Go types for input and output models
- Generates JSON Schema from Go types
- Static typing for path/query/header params, bodies, response headers, etc.
- Automatic input model validation & error handling
- Documentation generation using Stoplight Elements
- Optional CLI built-in, configured via arguments or environment variables
- Set via e.g.
-p 8000
,--port=8000
, orSERVICE_PORT=8000
- Startup actions & graceful shutdown built-in
- Set via e.g.
- Generates OpenAPI for access to a rich ecosystem of tools
- Mocks with API Sprout or Prism
- SDKs with OpenAPI Generator or oapi-codegen
- CLI with Restish
- And plenty more
- Generates JSON Schema for each resource using optional
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. Logo & branding designed by Kari Taylor.