fix jsonpath matcher (#311)

This commit is contained in:
Stef Heyenrath
2019-10-09 13:08:02 +02:00
committed by GitHub
parent 7789f94737
commit 87534c35f5

View File

@@ -93,10 +93,7 @@ namespace WireMock.Matchers
private double IsMatch(JToken jtoken)
{
// Wrap in array if needed
JToken tokenOrArray = jtoken is JArray ? jtoken : new JArray(jtoken);
return MatchScores.ToScore(_patterns.Select(pattern => tokenOrArray.SelectToken(pattern) != null));
return MatchScores.ToScore(_patterns.Select(pattern => jtoken.SelectToken(pattern) != null));
}
}
}