From 467db027e97f4e0071b643bdcdbb3f4d49ea8494 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Tue, 27 Feb 2024 08:14:12 +0100 Subject: [PATCH] Updated Request Matchers (markdown) --- Request-Matchers.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Request-Matchers.md b/Request-Matchers.md index de76780..a26e90b 100644 --- a/Request-Matchers.md +++ b/Request-Matchers.md @@ -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.