Closed timurnes closed 11 months ago
@timurnes
Looks ok to me. Can you make a PR with code change + unit tests?
However I think that this same logic needs to be applied to line 66 if a Regex is used:
if (Regex && value.Type == JTokenType.String && input != null)
@StefH Created PR #972
I haven't added any changes to Regex logic because I can't imagine how we can create valid regex with Guid type. So Guid field will be skipped and matched on the next condition that is added with this PR
As a WireMock user I'd like to setup JsonPartialMatcher using anonymous object with some Guid fields. As of now I have to cast Guid fields to string because this condition in AbstractJsonPartialMatcher rejects match - value type is JTokenType.Guid and input type is JTokenType.String.
Generally, guid in json is a string so I think this feature can simplify user code a bit and won't be a breaking change
Possible solution is to add a check before the condition I've specified above
Unit test in JsonPartialMatcherTests: