JSON Partial Matcher
Last updated
Last updated
JSON Partial matching will match if you provide snippet of JSON that exists within the incoming request payload.
Unlike a JSON matcher which does the full comparison matching of two JSON documents (the JSON in the request body with the JSON you have specified as the matcher value), the JSON Partial matcher evaluates if the matcher value is a subset of the incoming JSON document.
The matcher ignores any absent fields and lets you match only the part of JSON document you care about.
Matcher value
Positive match payload
Non match payload
{"surname": "Doe"}
{
"name": "John",
"surname": "Doe"
}
{
"name": "John",
"surname": "Ross"
}
{
"name": "John",
"surname": "Doe",
"age":30
}
{
"people": [
{
"name": "John",
"surname": "Doe",
"age": 30
}
]
}
{
"name": "John",
"surname": "Doe"
}