Hi, Does anyone have a reply to my previous message please:
Hey everyone, I am trying to use the JsonPathMatcher but don't seem to be getting any success. I am using wiremock.net nuget in a .NET6 project. this is the code I have:
This is my request:
{
"person": {
"forename": "Test",
"surname": "APPLE"
}
}
server.Given(Request.Create().WithPath(_urlPath).WithHeader("content-type", "application/json").UsingPost().WithBody(new JsonPathMatcher("$.person.surname == 'APPLE'"))).RespondWith(Response.Create().WithStatusCode(200).WithHeader("content-type", "application/json;charset=UTF-8").WithBodyAsJson(new FileInfo("ResponseFiles/Apple.json").FullName));
I have tried using the following variations:
new JsonPathMatcher("[?(@.surname == 'APPLE')]")
new JsonPathMatcher("person.surname == 'APPLE')]")
Any help would be greatly appreciated 🙂
o
Oleg Nenashev
04/26/2023, 11:18 AM
Sorry, it went missing. I will ask the WireMock.NET maintainer whether he'd like to join
Hey, Thank you for the replies, It's greatly appreciated. I will join the Lobby and see if there is a solution. Also, I will take a look at the JmesPathMatcher. :-)