Updated Request Matchers (markdown)

Stef Heyenrath
2024-02-27 08:14:12 +01:00
parent 9db8787270
commit 467db027e9

@@ -154,6 +154,21 @@ server
{ "things": { "name": "Wiremock" } }
```
### Jmes Path (JmesPathMatcher)
The JMESPath language is described in an ABNF grammar with a complete specification.
A JSON body will be considered to match a path expression if the expression returns either a non-null single value (string, integer etc.), or a non-empty object or array.
#### C#
```csharp
var server = WireMockServer.Start();
server
.Given(
Request.Create().WithPath("/jmespath_example").UsingGet()
.WithBody(new JmesPathMatcher("things.name == 'RequiredThing"));
)
.RespondWith(Response.Create().WithBody("Hello"));
```
### XPathMatcher
Deems a match if the attribute value is valid XML and matches the XPath expression supplied.
An XML document will be considered to match if any elements are returned by the XPath evaluation.