Compare commits

..

2 Commits
1.6.8 ... 1.6.9

Author SHA1 Message Date
Stef Heyenrath
c548600dea 1.6.9 2024-12-06 19:22:25 +01:00
Stef Heyenrath
7f640dfa0d Fix JsonPartialMatcher when using property names with dot (#1216)
Fix JsonPartialMatcher when using property names with dot (#1216)
2024-12-06 09:23:31 +01:00
6 changed files with 28 additions and 12 deletions

View File

@@ -1,4 +1,8 @@
# 1.6.8 (23 November 2024)
# 1.6.9 (06 December 2024)
- [#1216](https://github.com/WireMock-Net/WireMock.Net/pull/1216) - Fix JsonPartialMatcher when using property names with dot [bug] contributed by [StefH](https://github.com/StefH)
- [#1210](https://github.com/WireMock-Net/WireMock.Net/issues/1210) - JsonPartialMatcher fails to match on property name that JsonMatcher matches [bug]
# 1.6.8 (24 November 2024)
- [#1202](https://github.com/WireMock-Net/WireMock.Net/pull/1202) - Log exception when (static) mapping file cannot be read [feature] contributed by [StefH](https://github.com/StefH)
- [#1206](https://github.com/WireMock-Net/WireMock.Net/pull/1206) - Fix security issues [bug] contributed by [StefH](https://github.com/StefH)
- [#1211](https://github.com/WireMock-Net/WireMock.Net/pull/1211) - Use GraphQL 8.2.1 [feature] contributed by [StefH](https://github.com/StefH)

View File

@@ -4,7 +4,7 @@
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.6.8</VersionPrefix>
<VersionPrefix>1.6.9</VersionPrefix>
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
<PackageProjectUrl>https://github.com/WireMock-Net/WireMock.Net</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

View File

@@ -1,6 +1,6 @@
rem https://github.com/StefH/GitHubReleaseNotes
SET version=1.6.8
SET version=1.6.9
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN%

View File

@@ -1,10 +1,5 @@
# 1.6.8 (23 November 2024)
- #1202 Log exception when (static) mapping file cannot be read [feature]
- #1206 Fix security issues [bug]
- #1211 Use GraphQL 8.2.1 [feature]
- #1213 Fix HandlebarsContext ParseAndEvaluate method [bug]
- #1201 Mapping file parse errors are not logged to the console [feature]
- #1209 Upgrade of GraphQL libs to the latest [feature]
- #1212 Response Body Does Not Include Text After Path Segment [bug]
# 1.6.9 (06 December 2024)
- #1216 Fix JsonPartialMatcher when using property names with dot [bug]
- #1210 JsonPartialMatcher fails to match on property name that JsonMatcher matches [bug]
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md

View File

@@ -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[]>();

View File

@@ -293,6 +293,23 @@ public class JsonPartialMatcherTests
Assert.Equal(1.0, match);
}
[Fact]
public void JsonPartialMatcher_IsMatch_JObjectAsStringWithDottedPropertyName()
{
// Assign
var matcher = new JsonPartialMatcher("{ \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\" : \"Test\" }");
// Act
var jObject = new JObject
{
{ "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", new JValue("Test") }
};
var match = matcher.IsMatch(jObject).Score;
// Assert
Assert.Equal(1.0, match);
}
[Fact]
public void JsonPartialMatcher_IsMatch_GuidAsString()
{