Skip to main content

parse_json_records

Function parse_json_records 

Source
pub fn parse_json_records(content: &str) -> Result<Vec<Value>>
Expand description

Parse JSON content as either a JSON array of objects or JSONL (newline-delimited JSON, one object per line). The format is detected by peeking at the first non-whitespace byte: [ starts an array, anything else is parsed line-by-line.

Empty and whitespace-only lines are skipped in JSONL mode. Parse errors in JSONL mode include the source line number.