Function fix_json

Source
pub fn fix_json(partial_json: &str) -> String
Expand description

Takes a partial JSON string, kinda parses it and returns a complete JSON string. This function keeps the JSON as a string, goes through it and analyzes the brackets, strings, etc, to determine the missing stuff, and adds it. This approach is likely faster than the parsing appraoch (TODO: benchmmark maybe) It’s assumed that the given JSON would always be a valid incomplete JSON.