API DSL Reference
Overview
Section titled “Overview”The .api DSL is go-zero’s domain-specific language for describing HTTP APIs. This section covers every feature of the DSL.
Contents
Section titled “Contents”- Route Rules — Define URL patterns, methods, and handlers
- Route Groups — Organize routes with shared settings
- Route Prefix — Add a URL prefix to a group
- Parameters — Request and response field types and tags
- Types — Define shared request/response structs
- JWT Authentication — Protect routes with JWT
- Middleware — Apply pre/post-processing to routes
- Request Signing — HMAC signature verification
- Import — Split
.apifiles with imports - SSE Routes — Server-Sent Events endpoints
- FAQ — Common questions and answers