mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Question: JsonPathMatcher - not matching? Correct syntax? #89
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rangerranger on GitHub (Apr 9, 2018).
Hi - I'm not having my json match with the JsonPathMatcher. For example, I use:
But it never matches that request. Does the "pattern" to JsonPathMatcher have to be in a specific syntax?
I ended up adding a JsonExactMatcher (that just matches json exactly), since the JsonPathMatcher wasn't working for me. Could you suggest if something is wrong with the above code?
@kwucode commented on GitHub (Apr 10, 2018):
Please see JSONPath syntax.
@rangerranger commented on GitHub (Apr 10, 2018):
Thanks Kevin. I guess in terms of json path syntax i need “$..*” - to match all members of my json exactly?
How would i create the request object in the above code?
@StefH commented on GitHub (May 17, 2018):
The latest version from WireMock does now also support using a normal WildcardMatcher if you want to match a json message.
So this code should also work like this example:
@StefH commented on GitHub (Jul 2, 2018):
A new
JsonMatcherhas been added in latest version which enables you to match a json object 1:1.See also https://github.com/WireMock-Net/WireMock.Net/issues/154
Closing this issue now...