Docs: Document the API JSON field-casing convention

Add the TitleCase (entity-backed) vs camelCase (generated/artificial) rule to the
API package guide and the api-and-config rule's API Shape Checklist.
This commit is contained in:
Michael Mayer 2026-06-09 03:18:15 +00:00
parent 96f84c37e2
commit 8f7866617a
2 changed files with 2 additions and 0 deletions

View file

@ -20,6 +20,7 @@
## API Shape Checklist
When renaming or adding fields:
- Field casing: **TitleCase** (`UUID`, `Name`, `SiteUrl`) for fields backed by a DB entity (mirror the entity/model), **camelCase** (`storageNamespace`, `redirectUri`) for generated/artificial payloads (client config, session, action/RPC bodies). A filtered/computed entity projection stays TitleCase; an action payload stays camelCase but MAY TitleCase its single entity-identity field (e.g. `UUID`). See `specs/common/field-casing.md`.
- Update DTOs in `internal/service/cluster/response.go` and any mappers.
- Update handlers and regenerate Swagger: `make fmt-go swag-fmt swag`.
- Update tests (search/replace old field names) and examples in `specs/`.