MatcherMapper : Always use Pattern (#716)

This commit is contained in:
Stef Heyenrath
2022-01-27 12:33:48 +01:00
committed by GitHub
parent 288a50ccaf
commit f2fab98abb
5 changed files with 143 additions and 92 deletions

View File

@@ -161,12 +161,12 @@ namespace WireMock.Serialization
// If the matcher is a IValueMatcher, get the value (can be string or object).
case IValueMatcher valueMatcher:
model.Patterns = new[] { valueMatcher.Value };
model.Pattern = valueMatcher.Value;
break;
// If the matcher is a ExactObjectMatcher, get the ValueAsObject or ValueAsBytes.
case ExactObjectMatcher exactObjectMatcher:
model.Patterns = new[] { exactObjectMatcher.ValueAsObject ?? exactObjectMatcher.ValueAsBytes };
model.Pattern = exactObjectMatcher.ValueAsObject ?? exactObjectMatcher.ValueAsBytes;
break;
}