mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
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:
parent
96f84c37e2
commit
8f7866617a
2 changed files with 2 additions and 0 deletions
|
|
@ -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/`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue