Case sensitive true is ignored for JsonMatcher #205

Closed
opened 2025-12-29 14:25:05 +01:00 by adam · 12 comments
Owner

Originally created by @viktorpeacock on GitHub (Aug 22, 2019).

The JSON matcher is doing a deep compare on JSON string and it looks like it's case sensitive. When creating a matcher, I specify CaseSensitive = false, but this is not used by the matcher. Should it be possible to configure JSON matcher to be case insensitive?

https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Matchers/JsonMatcher.cs

Originally created by @viktorpeacock on GitHub (Aug 22, 2019). The JSON matcher is doing a deep compare on JSON string and it looks like it's case sensitive. When creating a matcher, I specify CaseSensitive = false, but this is not used by the matcher. Should it be possible to configure JSON matcher to be case insensitive? https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Matchers/JsonMatcher.cs
adam added the feature label 2025-12-29 14:25:05 +01:00
adam closed this issue 2025-12-29 14:25:05 +01:00
Author
Owner

@StefH commented on GitHub (Aug 22, 2019):

This can be implemented, however only for strings.

@StefH commented on GitHub (Aug 22, 2019): This can be implemented, however only for strings.
Author
Owner

@viktorpeacock commented on GitHub (Aug 22, 2019):

This would help a lot. Can try doing PR myself with a bit of direction on how you'd like this to be implemented.

@viktorpeacock commented on GitHub (Aug 22, 2019): This would help a lot. Can try doing PR myself with a bit of direction on how you'd like this to be implemented.
Author
Owner

@StefH commented on GitHub (Aug 22, 2019):

I'm looking into this.

@StefH commented on GitHub (Aug 22, 2019): I'm looking into this.
Author
Owner

@StefH commented on GitHub (Aug 22, 2019):

And would it be required to also match the property-names CaseIgnore? Or only the string-values?

@StefH commented on GitHub (Aug 22, 2019): And would it be required to also match the property-names CaseIgnore? Or only the string-values?
Author
Owner

@StefH commented on GitHub (Aug 22, 2019):

@viktorpeacock If you want to test this. see preview NuGet : WireMock.Net.1.0.28-ci-11761

@StefH commented on GitHub (Aug 22, 2019): @viktorpeacock If you want to test this. see preview NuGet : `WireMock.Net.1.0.28-ci-11761`
Author
Owner

@viktorpeacock commented on GitHub (Aug 22, 2019):

Hi, it would help if we could ignore case on both values and property names. Potentially have two properties: IgnoreCaseOnProperties and IgnoreCaseOnPropertyValues?

@viktorpeacock commented on GitHub (Aug 22, 2019): Hi, it would help if we could ignore case on both values and property names. Potentially have two properties: IgnoreCaseOnProperties and IgnoreCaseOnPropertyValues?
Author
Owner

@StefH commented on GitHub (Aug 22, 2019):

Just a single IgnoreCase is easier to build and use I think.

@StefH commented on GitHub (Aug 22, 2019): Just a single `IgnoreCase` is easier to build and use I think.
Author
Owner

@StefH commented on GitHub (Aug 22, 2019):

Please test WireMock.Net.1.0.28-ci-11769 , this version renames the property name + value.

@StefH commented on GitHub (Aug 22, 2019): Please test `WireMock.Net.1.0.28-ci-11769` , this version renames the property name + value.
Author
Owner

@viktorpeacock commented on GitHub (Aug 23, 2019):

Any chance you can post a docker image please as we host wiremock in k8s?

Agree RE: IgnoreCase :-) Thank you so much for very fast response!

@viktorpeacock commented on GitHub (Aug 23, 2019): Any chance you can post a docker image please as we host wiremock in k8s? Agree RE: IgnoreCase :-) Thank you so much for very fast response!
Author
Owner

@StefH commented on GitHub (Aug 23, 2019):

I can merge this logic to the master and create a new Docker because (as far I see) the original logic is still the same.
So tonight or tomorrow I will create new Docker.

@StefH commented on GitHub (Aug 23, 2019): I can merge this logic to the master and create a new Docker because (as far I see) the original logic is still the same. So tonight or tomorrow I will create new Docker.
Author
Owner

@StefH commented on GitHub (Aug 24, 2019):

@viktorpeacock docker is created

@StefH commented on GitHub (Aug 24, 2019): @viktorpeacock docker is created
Author
Owner

@viktorpeacock commented on GitHub (Aug 28, 2019):

Thank you. Will try this out today!

@viktorpeacock commented on GitHub (Aug 28, 2019): Thank you. Will try this out today!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#205