mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 07:07:21 +00:00
Generated the JSON contracts of visual briefings and model answers at compile time (#1151)
This commit is contained in:
1 parent
24e3c22db3
commit
770c16e20a
101 files changed
+2333
-392
No files matched your search
@@ -8,7 +8,7 @@ namespace AIStudio.Tests.Serialization;
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Files written by an older version of AI Studio lack every property added since, and an answer of a
|
||||
/// provider, of the runtime, or of a service leaves out whatever it has nothing to say about. Reading them has
|
||||
/// provider, of the runtime, of a service, or of a model leaves out whatever it has nothing to say about. Reading them has
|
||||
/// to give those properties their defaults, as a new object has them, e.g., a sub-object of the settings
|
||||
/// instead of null. Source generation in .NET 10 breaks this for init-only properties: it sets them all while
|
||||
/// creating the object, and a property missing in the JSON gets the default of its type instead
|
||||
@@ -25,6 +25,9 @@ public sealed class JsonDefaultsTests
|
||||
[TestCaseSource(typeof(JsonTestRoots), nameof(JsonTestRoots.ProviderAnswers))]
|
||||
[TestCaseSource(typeof(JsonTestRoots), nameof(JsonTestRoots.RuntimeAnswers))]
|
||||
[TestCaseSource(typeof(JsonTestRoots), nameof(JsonTestRoots.ServiceAnswers))]
|
||||
[TestCaseSource(typeof(JsonTestRoots), nameof(JsonTestRoots.VisualBriefingStored))]
|
||||
[TestCaseSource(typeof(JsonTestRoots), nameof(JsonTestRoots.VisualBriefingAnswers))]
|
||||
[TestCaseSource(typeof(JsonTestRoots), nameof(JsonTestRoots.ModelAnswers))]
|
||||
public void AnEmptyObjectGetsTheDefaultsOfANewOne(JsonTestRoot root)
|
||||
{
|
||||
var baseline = JsonReflectionBaseline.Of(root.Options);
|
||||
|
||||
Reference in new issue
Block a user