WireMock.Net icon indicating copy to clipboard operation
WireMock.Net copied to clipboard

Bug: WireMock.Net is not matching application/json http requests using JSONPathMatcher

Open aledaccas opened this issue 8 years ago • 6 comments

The JSONPathMatcher does not match a json body request. (Using the IRequestBuilder .WithBody()) This is because the RequestMessageBodyMatcher only uses the .Body property and not the .BodyAsJson property. to get working, either Body and BodyAsJson must be filled with the body string from request.

aledaccas avatar Feb 19 '18 18:02 aledaccas

This was broken during the last changes. I will take a look.

StefH avatar Feb 20 '18 08:02 StefH

Hello @aledaccas

I did fix it, however, can you please take a look at my code https://github.com/WireMock-Net/WireMock.Net/compare/json?expand=1 before I commit and create a new NuGet ?

StefH avatar Feb 21 '18 18:02 StefH

@StefH Is it possible to open a PR, so conversation on the changes is easy?

joostvanhassel avatar Feb 22 '18 10:02 joostvanhassel

@joostvanhassel I did add you as reviewer to a the PR. https://github.com/WireMock-Net/WireMock.Net/pull/92

StefH avatar Feb 22 '18 10:02 StefH

Hi Stef I’ll take a look today.

Regards,

aledaccas avatar Feb 22 '18 12:02 aledaccas

Stef, I’d a look and for me It’s ok.

You’ve created more interfaces inheriting from IMatcher passing object as parameter for IsMatch method, adjusted the Matchers and changed the RequestMessage*Matcher classes to adapt to this new matchers. Sweet! ☺

Regards.

Aledaccas

From: Alexandre Daccas Mendonça Sent: quinta-feira, 22 de fevereiro de 2018 09:14 To: 'WireMock-Net/WireMock.Net' [email protected]; WireMock-Net/WireMock.Net [email protected] Cc: Mention [email protected] Subject: RE: [WireMock-Net/WireMock.Net] Bug: WireMock.Net is not matching application/json http requests using JSONPathMatcher (#91)

Hi Stef I’ll take a look today.

Regards,

aledaccas avatar Feb 22 '18 12:02 aledaccas