https://linen.dev logo
#help
Title
# help
c

Callum Johnson

04/17/2023, 2:47 PM
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 🙂
Anyone, please?
14 Views