node-consumer-pact-validation
Version:
A consumer pact generator written for pure nodeJS
38 lines (37 loc) • 801 B
JSON
{
"match": true,
"comment": "Types and regular expressions match",
"expected" : {
"method": "POST",
"path": "/",
"query": "",
"headers": {"Content-Type": "application/json"},
"matchingRules": {
"$.body.animals": {"min": 1, "match": "type"},
"$.body.animals[*].*": {"match": "type"},
"$.body.animals[*].phoneNumber": {"match": "regex", "regex": "\\d+"}
},
"body": {
"animals": [
{
"phoneNumber": "0415674567"
}
]
}
},
"actual": {
"method": "POST",
"path": "/",
"query": "",
"headers": {"Content-Type": "application/json"},
"body": {
"animals": [
{
"phoneNumber": "333"
},{
"phoneNumber": "983479823479283478923"
}
]
}
}
}