mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-11-15 21:32:40 +01:00
Fix JsonPartialMatcher when using property names with dot (#1216)
Fix JsonPartialMatcher when using property names with dot (#1216)
This commit is contained in:
1 parent
4b3e9feca0
commit
7f640dfa0d
2 files changed
+18
-1
No files matched your search
@@ -82,7 +82,7 @@ public abstract class AbstractJsonPartialMatcher : JsonMatcher
|
||||
case JTokenType.Object:
|
||||
var nestedValues = value.ToObject<Dictionary<string, JToken>>();
|
||||
return nestedValues?.Any() != true ||
|
||||
nestedValues.All(pair => IsMatch(pair.Value, input.SelectToken(pair.Key)));
|
||||
nestedValues.All(pair => IsMatch(pair.Value, input.SelectToken(pair.Key) ?? input[pair.Key])); // First try to select based on JPath expression, else just get the value.
|
||||
|
||||
case JTokenType.Array:
|
||||
var valuesArray = value.ToObject<JToken[]>();
|
||||
|
||||
Reference in new issue
Block a user