node-consumer-pact-validation
Version:
A consumer pact generator written for pure nodeJS
52 lines (51 loc) • 1.05 kB
JSON
{
"match": true,
"comment": "Nested arrays match",
"expected" : {
"method": "POST",
"path": "/",
"query": "",
"headers": {"Content-Type": "application/json"},
"matchingRules": {
"$.body.animals": {"min": 1, "match": "type"},
"$.body.animals[*].*": {"match": "type"},
"$.body.animals[*].children": {"min": 1, "match": "type"},
"$.body.animals[*].children[*].*": {"match": "type"}
},
"body": {
"animals": [
{
"name" : "Fred",
"children": [
{
"age": 9
}
]
}
]
}
},
"actual": {
"method": "POST",
"path": "/",
"query": "",
"headers": {"Content-Type": "application/json"},
"body": {
"animals": [
{
"name" : "Mary",
"children": [
{"age": 3},
{"age": 5},
{"age": 5456}
]
},{
"name" : "Jo",
"children": [
{"age": 0}
]
}
]
}
}
}