pub fn flatten_json_for_csv(value: &Value) -> (Vec<String>, Vec<Vec<String>>)Expand description
Flattens a JSON Value into a list of records for CSV export.
Returns a tuple of (headers, rows), where rows are vectors of strings corresponding to headers.
- If
valueis an Array, each element becomes a row. - If
valueis an Object, it becomes a single row. - Nested objects are flattened with dot notation.
- Arrays inside objects are serialized as JSON strings.