Support for partial JSON matching (#539)

* support Json partial match with JsonPartialMatcher

* fix erroneous filenames

* add newline

* newlines fix

* add JsonPartialMatcher to mapper

* curly braces for ifs

* fix JToken type comparison

* more test cases

* rename AreEqual -> IsMatch + more test cases

* separate tests for JPath matcher values

Co-authored-by: Gleb Osokin <gleb.osokin@avira.com>
This commit is contained in:
Gleb Osokin
2020-11-17 17:18:58 +01:00
committed by GitHub
parent 2d95167866
commit 548fc2c2c8
5 changed files with 578 additions and 17 deletions

View File

@@ -67,6 +67,10 @@ namespace WireMock.Serialization
object value = matcher.Pattern ?? matcher.Patterns;
return new JsonMatcher(matchBehaviour, value, ignoreCase, throwExceptionWhenMatcherFails);
case "JsonPartialMatcher":
object matcherValue = matcher.Pattern ?? matcher.Patterns;
return new JsonPartialMatcher(matchBehaviour, matcherValue, ignoreCase, throwExceptionWhenMatcherFails);
case "JsonPathMatcher":
return new JsonPathMatcher(matchBehaviour, throwExceptionWhenMatcherFails, stringPatterns);