pub fn extract_account_id(
args: Value,
) -> Result<(Id, Map<String, Value>), JmapError>Expand description
Extract accountId from a JMAP method arguments envelope and return both
the extracted Id and the remaining argument map.
The caller passes the full args: Value from the method invocation by
value; this function destructures it once, so handlers do not have to
repeat the let Value::Object(mut args) = args else { ... } pattern after
every call.
§Errors
Returns invalidArguments with:
"arguments must be an object containing accountId"whenargsis not a JSON object."accountId is required"when the field is missing or not a string."accountId is not a valid Id: <reason>"when the field is a string but does not satisfy the RFC 8620 §1.2 Id grammar (Id::new_validated). Catches empty strings, strings longer than 255 bytes, and strings containing characters outside the SAFE-CHAR set (%x21 / %x23-7E— visible ASCII excluding"). bd:JMAP-wlip.5 closed the previous silent-pass-through behaviour where a malformed accountId reached the backend’saccount_existscall and surfaced as eithernotFoundor a storage-layer parse error, depending on the backend.