Module json

Module json 

Source

Macros§

contains_each
Matches a JSON array that contains distinct matches for each provided matcher, ignoring order.
each
Matches every element of a JSON array against the same matcher.
elements_are
Matches a JSON array against a list of matchers in order.
has_path_with
Matches a JSON leaf at the given path against the provided matcher.
is_contained_in
Matches a JSON array where every element satisfies one of the provided matchers without reuse.
len
Matches the length of a JSON array against a literal or matcher.
matches_pattern
Matches a JSON object against a pattern of key-value matchers.
optional
Matches a JSON field that may be absent, null, or satisfy an inner matcher.
pat
Matches a JSON object against a pattern of key-value matchers.
primitive
Matches a JSON string, number, or boolean against the given matcher.
unordered_elements_are
Matches a JSON array whose elements pair one-to-one with the provided matchers, ignoring order.
valueDeprecated
Matches a JSON string, number, or boolean against the given matcher.

Functions§

any_valueDeprecated
Matches JSON values that are not null.
has_only_paths
Matches a JSON object whose paths are exactly the provided set (no extras or missing).
has_paths
Matches a JSON object that contains all specified paths (order-agnostic, extras allowed).
is_array
Matches JSON array values.
is_boolean
Matches JSON boolean values.
is_empty_array
Matches an empty JSON array ([]).
is_empty_object
Matches an empty JSON object ({}).
is_false
Matches the JSON boolean false value.
is_fractional_number
Matches JSON numbers that have a non-zero fractional part.
is_integer
Matches JSON numbers that are integers.
is_not_null
Matches JSON values that are not null.
is_null
Matches JSON null values.
is_number
Matches JSON number values.
is_object
Matches JSON object values.
is_string
Matches JSON string values.
is_true
Matches the JSON boolean true value.
is_whole_number
Matches JSON numbers whose fractional part is zero (e.g., 2 or 2.0).
predicate
Builds a JSON matcher from an arbitrary predicate function.