You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: make tenant settings PATCH an RFC 7396 merge patch
PATCH now follows JSON Merge Patch (RFC 7396): a member with a value sets
that setting, an explicit JSON null removes the key, and an omitted member
is left unchanged. Previously an empty string cleared a field and there was
no way to remove a key (the JSONB `||` merge could only add or overwrite).
- models: add a small generic Optional[T] that distinguishes absent vs null
vs value when decoding a merge-patch body; PatchTenantSettingsRequest uses
it instead of *string.
- service: translate the typed request into keys-to-set and keys-to-remove;
reject an explicit empty string (clear via null), keeping the value
contract "a valid BCP-47 locale, or null to remove".
- repository: Patch applies (settings || set) - removeKeys::text[], so null
members delete keys while unmentioned keys survive; writeSettings takes the
extra bind. Upsert (full replace) is unchanged.
- openapi: declare application/merge-patch+json (application/json still
accepted), make target_language nullable, document the null-removes rule.
- tests: Optional tri-state unit test; service set/remove/empty-rejected
cases; integration PatchNullRemovesField (key deleted, siblings kept) and
PatchEmptyStringRejected.
ENG-1254
0 commit comments