Massive thanks to @kapishmalik and @petkostas! Hoverfly's simulation schema has been bumped to v5.2 to support these new awesome matchers 🚀 :
- Array matcher: supports loose matching for array values, and this will be the default matcher for multi-value query param or header in captured data.
- Form matcher: matches request payload with URL encoded form.
- JWT matcher: has a built-in JWT parser, and lets you match JWT with its decoded JSON form directly.
Most excitingly new schema lets you do matcher chaining to create powerful matchers, for example, you can match a JWT token's payload containing a name JSON field with the value "John Doe", and the JWT token is present in a URL encoded form.
"body": [{
"matcher": "form",
"value": {
"client_assertion": [{
"matcher": "jwt",
"value": "{\"header\":{\"alg\":\"HS256\"},\"payload\":{}}",
"doMatch": {
"matcher": "jsonpath",
"value": "$.payload",
"doMatch": {
"matcher": "jsonpath",
"value": "$.name",
"doMatch": {
"matcher": "exact",
"value": "John Doe"
}
}
}
}]
}
}]
For more info, please check out the doc here.
v5.2 simulation also supports declaring global literals and variables for templated response. These are the constants and helper methods which you want to re-use for templating throughout a simulation.
Other changes include Go version upgrade to 1.18 and other dependency bumps (thanks @joobus )