has_paths

Function has_paths 

Source
pub fn has_paths(
    paths: &[&str],
) -> JsonPredicateMatcher<impl Fn(&Value) -> bool, String, String>
Expand description

Matches a JSON object that contains all specified paths (order-agnostic, extras allowed).

Paths use dot notation; escape dots inside field names with \.

§Examples

let value = j!({"user": {"id": 7, "name": "Ada"}});
assert_that!(value, json::has_paths(&["user.id", "user.name"]));

§Errors

Fails when any path is invalid, when the value is not a JSON object, or when required paths are missing.