fix: arrayContains matcher JSON was missing match attribute
@@ -278,31 +278,32 @@ impl MatchingRule {
/// Converts this `MatchingRule` to a `Value` struct
pub fn to_json(&self) -> Value {
match self {
- MatchingRule::Equality => json!({ "match": Value::String(s!("equality")) }),
- MatchingRule::Regex(ref r) => json!({ "match": Value::String(s!("regex")),
- "regex": Value::String(r.clone()) }),
- MatchingRule::Type => json!({ "match": Value::String(s!("type")) }),
- MatchingRule::MinType(min) => json!({ "match": Value::String(s!("type")),
+ MatchingRule::Equality => json!({ "match": "equality" }),
+ MatchingRule::Regex(ref r) => json!({ "match": "regex",
+ "regex": r.clone() }),
+ MatchingRule::Type => json!({ "match": "type" }),
+ MatchingRule::MinType(min) => json!({ "match": "type",
"min": json!(*min as u64) }),
- MatchingRule::MaxType(max) => json!({ "match": Value::String(s!("type")),
+ MatchingRule::MaxType(max) => json!({ "match": "type",
"max": json!(*max as u64) }),
- MatchingRule::MinMaxType(min, max) => json!({ "match": Value::String(s!("type")),
+ MatchingRule::MinMaxType(min, max) => json!({ "match": "type",
"min": json!(*min as u64), "max": json!(*max as u64) }),
- MatchingRule::Timestamp(ref t) => json!({ "match": Value::String(s!("timestamp")),
+ MatchingRule::Timestamp(ref t) => json!({ "match": "timestamp",
"timestamp": Value::String(t.clone()) }),
- MatchingRule::Time(ref t) => json!({ s!("match"): Value::String(s!("time")),
- s!("time"): Value::String(t.clone()) }),
- MatchingRule::Date(ref d) => json!({ s!("match"): Value::String(s!("date")),
- s!("date"): Value::String(d.clone()) }),
- MatchingRule::Include(ref s) => json!({ "match": Value::String(s!("include")),
+ MatchingRule::Time(ref t) => json!({ "match": "time",
+ "time": Value::String(t.clone()) }),
+ MatchingRule::Date(ref d) => json!({ "match": "date",
+ "date": Value::String(d.clone()) }),
+ MatchingRule::Include(ref s) => json!({ "match": "include",
"value": Value::String(s.clone()) }),
- MatchingRule::Number => json!({ "match": Value::String(s!("number")) }),
- MatchingRule::Integer => json!({ "match": Value::String(s!("integer")) }),
- MatchingRule::Decimal => json!({ "match": Value::String(s!("decimal")) }),
- MatchingRule::Null => json!({ "match": Value::String(s!("null")) }),
- MatchingRule::ContentType(ref r) => json!({ "match": Value::String(s!("contentType")),
+ MatchingRule::Number => json!({ "match": "number" }),
+ MatchingRule::Integer => json!({ "match": "integer" }),
+ MatchingRule::Decimal => json!({ "match": "decimal" }),
+ MatchingRule::Null => json!({ "match": "null" }),
+ MatchingRule::ContentType(ref r) => json!({ "match": "contentType",
"value": Value::String(r.clone()) }),
MatchingRule::ArrayContains(variants) => json!({
+ "match": "arrayContains",
"variants": variants.iter().map(|(index, rules)| {
json!({
"index": index,
