Skip to main content

coerce_json_object

Function coerce_json_object 

Source
pub(crate) fn coerce_json_object(body: &str) -> Option<String>
Expand description

Try to make body parse as a JSON object, without changing what it says.

Returns the repaired text only when it parses and is an object; None otherwise, leaving the caller to fail exactly as it would have.