Refused JSON contracts built by reflection and checked all of them in the trimmed build (#1152)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-03 18:29:50 +01:00
1 parent f864359290
commit 0b42c0288e
23 files changed
+535 -99

No files matched your search

+4 -1
View File
@@ -45,7 +45,10 @@ public static class JsonContractWalker
return;
}
foreach (var property in typeInfo.Properties)
//
// System.Text.Json never meets the type of an ignored property, e.g., one marked with JsonIgnore:
//
foreach (var property in typeInfo.Properties.Where(property => property is not { Get: null, Set: null, AssociatedParameter: null }))
Visit(property.PropertyType, $"{path} → {property.Name}", options, visited, failures);
if (typeInfo.KeyType is { } keyType)