268
partial update
also PATCH, JSON Merge Patch
PATCH changes the fields it names. A missing field is left alone, not cleared.
What is partial update?
PUT replaces the resource. PATCH applies a change. In a merge patch, an absent field stays as it was, and null is how you clear, if your schema says null is allowed. JSON Patch is a list of operations. Treating a PATCH body as a full object fills the missing fields with defaults and wipes them.
Why does partial update matter when vibe coding?
The client sends `{ "name": "Ada" }` to change a name. The handler binds it to the entity, and the other columns become zero or null. The draft called that PATCH.
How do you do partial update?
Apply only fields present in the document. Distinguish absent from null. Validate the result. Use the version check so two partial edits do not clobber each other.
How do you ask a model for partial update?
PATCH (resource): change only fields present in the body. Do not set absent fields to null or to a default. Null may clear a field only if the schema allows it. Reject unknown fields.
What goes wrong with partial update?
A PATCH that triggers the same “create with defaults” binder as POST. Omitted required fields fail, or omitted optional fields reset.