Generated the JSON contracts of visual briefings and model answers at compile time (#1151)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-03 14:20:41 +01:00
1 parent 24e3c22db3
commit 770c16e20a
101 files changed
+2333 -392

No files matched your search

@@ -382,16 +382,15 @@ public partial class VisualBriefingAssistant
/// The fingerprint is serialized from exactly the values that SaveCurrentAsync
/// hands to the store. That is deliberate: a handwritten field list would silently stop
/// auto-saving whenever a new setting is added and someone forgets to list it here. Sources are
/// projected into a named shape because <c>System.Text.Json</c> ignores tuple fields and would
/// projected into a named record because <c>System.Text.Json</c> ignores tuple fields and would
/// otherwise serialize every source list into the same empty object.
/// </remarks>
/// <returns>The fingerprint of the current editor state.</returns>
private string BuildPersistenceFingerprint() => JsonSerializer.Serialize(
new
{
new VisualBriefingPersistenceFingerprint(
this.editor.Name,
this.editor.Author,
Settings = this.editor.ToSettings(),
Sources = this.editor.ToSources().Select(source => new { source.Path, source.Kind }).ToArray(),
}, VisualBriefingJson.Canonical);
this.editor.ToSettings(),
[.. this.editor.ToSources().Select(source => new VisualBriefingSourceFingerprint(source.Path, source.Kind))]),
VisualBriefingJson.Canonical);
}