Skip to main content

json_to_value_no_envelope

Function json_to_value_no_envelope 

Source
pub fn json_to_value_no_envelope(json: Value) -> Value
Expand description

Convert serde_json::Value to our AST Value without bytes-envelope sniffing.

External JSON (from fromjson, or native access traversal) must never silently become a Value::Bytes just because an object happens to match the base64 envelope shape ({"_type":"bytes",…}). That auto-decode is a feature of internal round-tripping only — it would be a silent, surprising conversion on untrusted input. Otherwise this is the same unwrap law as json_to_value: JSON scalars unwrap to native Value variants, and only objects/arrays stay Value::Json.