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

+10 -2
View File
@@ -15,14 +15,22 @@ public static class Program
//
AIStudio.Program.LOGGER_FACTORY = NullLoggerFactory.Instance;
var roots = JsonRoots.FindAll();
var failures = new List<string>();
foreach (var root in JsonRoots.ALL)
//
// Finding no options at all means looking in the wrong place, not a build without JSON:
//
if (roots.Count is 0)
failures.Add("Found no JSON options of AI Studio, see AppJsonOptions.FindAll, so nothing got checked.");
foreach (var root in roots)
failures.AddRange(JsonContractWalker.FindBrokenContracts(root));
failures.AddRange(JsonRoundTrips.FindLosses());
if (failures.Count is 0)
{
Console.WriteLine($"- All {JsonRoots.ALL.Count} JSON roots can be read and written.");
Console.WriteLine($"- All {roots.Count} JSON roots can be read and written.");
return 0;
}