Skip to main content

decode_unique_json

Function decode_unique_json 

Source
pub fn decode_unique_json<T: DeserializeOwned>(
    bytes: &[u8],
    max_bytes: usize,
) -> Result<T>
Expand description

Decode a bounded JSON command without losing duplicate keys or large integers.

The byte limit applies to the complete incoming request, including whitespace. Duplicate keys are rejected recursively before object insertion, including equivalent escaped spellings. Existing worker numeric-token checks run before constructing any JSON values. The target’s serde schema is then applied. Callers must additionally run their command’s domain validation; this helper does not impose the submission-specific data, metadata, or execution limits.