Skip to main content

refuse_duplicate_json_keys

Function refuse_duplicate_json_keys 

Source
pub fn refuse_duplicate_json_keys(raw: &[u8]) -> Result<(), String>
Expand description

The general-purpose duplicate-key rejection primitive, exposed for callers outside this crate (chat completions ingress, admin body parsers) that want the same trust-boundary “refuse ambiguous JSON” semantics without pulling in RpcError.

Returns Ok(()) if raw contains no duplicate keys at any nesting level; otherwise a description of the offending key.