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

Closed
opened 2025-12-29 14:21:55 +01:00 by adam · 6 comments
Owner

Originally created by @aledaccas on GitHub (Feb 19, 2018).

Originally assigned to: @StefH on GitHub.

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.

Originally created by @aledaccas on GitHub (Feb 19, 2018). Originally assigned to: @StefH on GitHub. 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.
adam added the bug label 2025-12-29 14:21:55 +01:00
adam closed this issue 2025-12-29 14:21:55 +01:00
Author
Owner

@StefH commented on GitHub (Feb 20, 2018):

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

@StefH commented on GitHub (Feb 20, 2018): This was broken during the last changes. I will take a look.
Author
Owner

@StefH commented on GitHub (Feb 21, 2018):

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 commented on GitHub (Feb 21, 2018): 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 ?
Author
Owner

@joostvanhassel commented on GitHub (Feb 22, 2018):

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

@joostvanhassel commented on GitHub (Feb 22, 2018): @StefH Is it possible to open a PR, so conversation on the changes is easy?
Author
Owner

@StefH commented on GitHub (Feb 22, 2018):

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

@StefH commented on GitHub (Feb 22, 2018): @joostvanhassel I did add you as reviewer to a the PR. https://github.com/WireMock-Net/WireMock.Net/pull/92
Author
Owner

@aledaccas commented on GitHub (Feb 22, 2018):

Hi Stef I’ll take a look today.

Regards,

@aledaccas commented on GitHub (Feb 22, 2018): Hi Stef I’ll take a look today. Regards,
Author
Owner

@aledaccas commented on GitHub (Feb 22, 2018):

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' reply@reply.github.com; WireMock-Net/WireMock.Net WireMock.Net@noreply.github.com
Cc: Mention mention@noreply.github.com
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 commented on GitHub (Feb 22, 2018): 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' <reply@reply.github.com>; WireMock-Net/WireMock.Net <WireMock.Net@noreply.github.com> Cc: Mention <mention@noreply.github.com> 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,
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#67