Skip to main content

strip_read_only_patch

Function strip_read_only_patch 

Source
pub fn strip_read_only_patch<O: SetObject>(
    patch: &mut Map<String, Value>,
    current: Option<&Map<String, Value>>,
) -> Result<(), Box<SetError>>
Expand description

Reject a /set update patch that changes a server-set or immutable property of O, then drop the keys that repeat the stored value.

Runs reject_read_only_patch with current, the stored object. When that passes, every key naming such a property holds its stored value (RFC 8620 §5.3) and is removed, leaving only the client changes. An empty result is a no-op update.

§Errors

The invalidProperties SetError from reject_read_only_patch.