Reputation: 1891
The sample JSON I use for stub
{
"request": {
...
"bodyPatterns" : [ {
"equalToJson" : "{ \"id\": abc123 }",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
...
},
here the id is a dynamic value, so in this case, how can I do the request matching in wire mock
Upvotes: 0
Views: 1344
Reputation: 4149
You can use a wildcard to match any value of id
:
"bodyPatterns" : [ {
"equalToJson" : "{ \"id\": \"${json-unit.any-string}\" }",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
Upvotes: 3