Packages and defaults
Choose a package, follow its guide, and check default settings.
Choose a package
| Guide | Responsibility | API |
|---|---|---|
core/jsonx | JSON encoding, decoding, and codecs | API |
core/errorx | Error wrapping, sequencing, and concurrent aggregation | API |
core/mapping | Tagged field binding and conversion | API |
rest/chain | Standard HTTP middleware composition | API |
rest/httpx | Request binding, validation, errors, and JSON responses | API |
rest | Routing, groups, mounts, and path policies | API |
Defaults
| Setting | Default | Configuration |
|---|---|---|
| JSON codec | encoding/json | jsonx.SetCodec, process-wide |
| JSON body limit | 8 MiB | httpx.WithMaxJSONBody, per call |
| Binding order | JSON → form → query → header → path | Present values from later sources override earlier ones |
| Validation | Call the target’s Validate() error | Automatic only in httpx.Parse |
| Path cleaning, escaped matching, slash redirects | Off | Enable with mux options |
| Automatic redirect status | 307 | rest.WithRedirectStatus |
| Error responses | DefaultErrorHandler | Server-error details are hidden by default |
Configure the global codec and error mapper at startup. Finish route registration before serving. See ServeMux migration for path policies.
Package relationships
All six production packages depend only on Mino and the Go standard library:
rest → rest/chain
rest/httpx → core/jsonx, core/mapping, core/errorx
core/mapping → core/errorx