node-consumer-pact-validation
Version:
A consumer pact generator written for pure nodeJS
43 lines (42 loc) • 892 B
JSON
{
"match": false,
"comment": "Nested arrays do not match, age is wrong type",
"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},
"$.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": "9"}]
}
]
}
}
}