mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 02:12:02 +01:00
Updated Request Matchers (markdown)
@@ -154,6 +154,21 @@ server
|
|||||||
{ "things": { "name": "Wiremock" } }
|
{ "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
|
### XPathMatcher
|
||||||
Deems a match if the attribute value is valid XML and matches the XPath expression supplied.
|
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.
|
An XML document will be considered to match if any elements are returned by the XPath evaluation.
|
||||||
|
|||||||
Reference in New Issue
Block a user