What problem does it solve?
Adding or porting resources to Vikunja's Huma-backed /api/v2 API involves many non-obvious conventions—typed per-operation handlers, shared envelopes, error bridging, doc tags, and AutoPatch behavior—that are easy to get wrong and produce silent bugs like empty lists or undocumented endpoints.
Core Features & Use Cases
- Per-operation Huma handlers: Guides creating typed handlers that pull auth from context, call the shared
handler.Do* functions, and translate domain errors into RFC 9457 problem+json responses.
- Schema documentation rules: Enforces
doc: and readOnly:"true" struct tags so the runtime-generated OpenAPI spec is complete, since Huma cannot read Go doc comments.
- Automatic machinery awareness: Explains what is handled automatically—PATCH via AutoPatch, API token permissions, global security schemes—so nothing is hand-rolled twice.
- Use Case: When porting the labels resource from v1 to v2, follow the reference implementation in
pkg/routes/api/v2/labels.go to register list/read/create/update/delete operations with correct envelopes, ETag handling, and mandatory webtests.
Quick Start
Add a new /api/v2 resource for my model by following the api-v2-routes skill, mirroring pkg/routes/api/v2/labels.go.