Skip to main content

read_json

Function read_json 

Source
pub fn read_json(text: &str) -> Result<Doc, OmnistError>
Expand description

Parse JSON text into a Doc.

A bare top-level array, an array nested directly inside another array, or nesting past crate::document::MAX_DEPTH all surface as crate::error::DocumentError (via Doc::of) rather than ParseError, matching Python’s read_json, which lets build_node’s DocumentError propagate uncaught alongside its own caught json.JSONDecodeError/ValueError -> ParseError translation.