diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.AnyOf.4.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.AnyOf.4.Json.g.cs deleted file mode 100644 index 7103840..0000000 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.AnyOf.4.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace TypeSafeAI.Generated -{ - public readonly partial struct AnyOf - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. - /// - public string ToJson() - { - return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::TypeSafeAI.Generated.AnyOf? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::TypeSafeAI.Generated.AnyOf), - jsonSerializerContext) as global::TypeSafeAI.Generated.AnyOf?; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::TypeSafeAI.Generated.AnyOf? FromJson( - string json) - { - return FromJson( - json, - global::TypeSafeAI.Generated.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::TypeSafeAI.Generated.AnyOf? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJson( - json, - global::TypeSafeAI.Generated.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.Deserialize>( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::TypeSafeAI.Generated.AnyOf), - jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.AnyOf?; - } - - /// - /// Deserializes a JSON stream using the generated default JsonSerializerContext. - /// - public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( - global::System.IO.Stream jsonStream) - { - return FromJsonStreamAsync( - jsonStream, - global::TypeSafeAI.Generated.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - if (jsonSerializerOptions is null) - { - return FromJsonStreamAsync( - jsonStream, - global::TypeSafeAI.Generated.SourceGenerationContext.Default); - } - - return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.AnyOf.4.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.AnyOf.4.g.cs deleted file mode 100644 index ec17fc3..0000000 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.AnyOf.4.g.cs +++ /dev/null @@ -1,460 +0,0 @@ - -#nullable enable - -namespace TypeSafeAI.Generated -{ - /// - /// - /// - public readonly partial struct AnyOf : global::System.IEquatable> - { - /// - /// - /// -#if NET6_0_OR_GREATER - public T1? Value1 { get; init; } -#else - public T1? Value1 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] -#endif - public bool IsValue1 => Value1 != null; - - /// - /// - /// - public bool TryPickValue1( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out T1? value) - { - value = Value1; - return IsValue1; - } - - /// - /// - /// - public T1 PickValue1() => Value1 is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); - - /// - /// - /// -#if NET6_0_OR_GREATER - public T2? Value2 { get; init; } -#else - public T2? Value2 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] -#endif - public bool IsValue2 => Value2 != null; - - /// - /// - /// - public bool TryPickValue2( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out T2? value) - { - value = Value2; - return IsValue2; - } - - /// - /// - /// - public T2 PickValue2() => Value2 is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); - - /// - /// - /// -#if NET6_0_OR_GREATER - public T3? Value3 { get; init; } -#else - public T3? Value3 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] -#endif - public bool IsValue3 => Value3 != null; - - /// - /// - /// - public bool TryPickValue3( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out T3? value) - { - value = Value3; - return IsValue3; - } - - /// - /// - /// - public T3 PickValue3() => Value3 is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); - - /// - /// - /// -#if NET6_0_OR_GREATER - public T4? Value4 { get; init; } -#else - public T4? Value4 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] -#endif - public bool IsValue4 => Value4 != null; - - /// - /// - /// - public bool TryPickValue4( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out T4? value) - { - value = Value4; - return IsValue4; - } - - /// - /// - /// - public T4 PickValue4() => Value4 is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); - /// - /// - /// - public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); - - /// - /// - /// - public static implicit operator T1?(AnyOf @this) => @this.Value1; - - /// - /// - /// - public AnyOf(T1? value) - { - Value1 = value; - } - - /// - /// - /// - public static AnyOf FromValue1(T1? value) => new AnyOf(value); - - /// - /// - /// - public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); - - /// - /// - /// - public static implicit operator T2?(AnyOf @this) => @this.Value2; - - /// - /// - /// - public AnyOf(T2? value) - { - Value2 = value; - } - - /// - /// - /// - public static AnyOf FromValue2(T2? value) => new AnyOf(value); - - /// - /// - /// - public static implicit operator AnyOf(T3 value) => new AnyOf((T3?)value); - - /// - /// - /// - public static implicit operator T3?(AnyOf @this) => @this.Value3; - - /// - /// - /// - public AnyOf(T3? value) - { - Value3 = value; - } - - /// - /// - /// - public static AnyOf FromValue3(T3? value) => new AnyOf(value); - - /// - /// - /// - public static implicit operator AnyOf(T4 value) => new AnyOf((T4?)value); - - /// - /// - /// - public static implicit operator T4?(AnyOf @this) => @this.Value4; - - /// - /// - /// - public AnyOf(T4? value) - { - Value4 = value; - } - - /// - /// - /// - public static AnyOf FromValue4(T4? value) => new AnyOf(value); - - /// - /// - /// - public AnyOf( - T1? value1, - T2? value2, - T3? value3, - T4? value4 - ) - { - Value1 = value1; - Value2 = value2; - Value3 = value3; - Value4 = value4; - } - - /// - /// - /// - public object? Object => - Value4 as object ?? - Value3 as object ?? - Value2 as object ?? - Value1 as object - ; - - /// - /// - /// - public override string? ToString() => - Value1?.ToString() ?? - Value2?.ToString() ?? - Value3?.ToString() ?? - Value4?.ToString() - ; - - /// - /// - /// - public bool Validate() - { - return IsValue1 || IsValue2 || IsValue3 || IsValue4; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? value1 = null, - global::System.Func? value2 = null, - global::System.Func? value3 = null, - global::System.Func? value4 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (Value1 is { } __value0 && value1 != null) - { - return value1(__value0); - } - else if (Value2 is { } __value1 && value2 != null) - { - return value2(__value1); - } - else if (Value3 is { } __value2 && value3 != null) - { - return value3(__value2); - } - else if (Value4 is { } __value3 && value4 != null) - { - return value4(__value3); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? value1 = null, - - global::System.Action? value2 = null, - - global::System.Action? value3 = null, - - global::System.Action? value4 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (Value1 is { } __value0) - { - value1?.Invoke(__value0); - } - else if (Value2 is { } __value1) - { - value2?.Invoke(__value1); - } - else if (Value3 is { } __value2) - { - value3?.Invoke(__value2); - } - else if (Value4 is { } __value3) - { - value4?.Invoke(__value3); - } - } - - /// - /// - /// - public void Switch( - global::System.Action? value1 = null, - global::System.Action? value2 = null, - global::System.Action? value3 = null, - global::System.Action? value4 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (Value1 is { } __value0) - { - value1?.Invoke(__value0); - } - else if (Value2 is { } __value1) - { - value2?.Invoke(__value1); - } - else if (Value3 is { } __value2) - { - value3?.Invoke(__value2); - } - else if (Value4 is { } __value3) - { - value4?.Invoke(__value3); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - Value1, - typeof(T1), - Value2, - typeof(T2), - Value3, - typeof(T3), - Value4, - typeof(T4), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(AnyOf other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) - ; - } - - /// - /// - /// - public static bool operator ==(AnyOf obj1, AnyOf obj2) - { - return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(AnyOf obj1, AnyOf obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is AnyOf o && Equals(o); - } - } -} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AnyOf4.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AnyOf4.g.cs deleted file mode 100644 index 9450707..0000000 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AnyOf4.g.cs +++ /dev/null @@ -1,271 +0,0 @@ -#nullable enable - -namespace TypeSafeAI.Generated.JsonConverters -{ - /// - public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> - { - /// - public override global::TypeSafeAI.Generated.AnyOf Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); - var __rawJson = __jsonDocument.RootElement.GetRawText(); - var __jsonProps = new global::System.Collections.Generic.HashSet(); - if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) - { - foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) - { - __jsonProps.Add(__jsonProp.Name); - } - } - - var __score0 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score0++; - } - } - } - var __score1 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score1++; - } - } - } - var __score2 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score2++; - } - } - } - var __score3 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T4), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score3++; - } - } - } - var __bestScore = 0; - var __bestIndex = -1; - if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } - if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } - if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } - if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } - - T1? value1 = default; - T2? value2 = default; - T3? value3 = default; - T4? value4 = default; - if (__bestIndex >= 0) - { - if (__bestIndex == 0) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 1) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 2) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 3) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - } - - if (value1 == null && value2 == null && value3 == null && value4 == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - if (value1 == null && value2 == null && value3 == null && value4 == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - if (value1 == null && value2 == null && value3 == null && value4 == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - if (value1 == null && value2 == null && value3 == null && value4 == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - var __value = new global::TypeSafeAI.Generated.AnyOf( - value1, - - value2, - - value3, - - value4 - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::TypeSafeAI.Generated.AnyOf value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsValue1) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue1(), typeInfo); - } - else if (value.IsValue2) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue2(), typeInfo); - } - else if (value.IsValue3) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue3(), typeInfo); - } - else if (value.IsValue4) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickValue4(), typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs index 7b94a0b..e09e6a5 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs @@ -23,19 +23,19 @@ namespace TypeSafeAI.Generated typeof(global::TypeSafeAI.Generated.JsonConverters.QuestionJsonConverter), - typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), - typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), - typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), - typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), - typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), - typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), @@ -58,7 +58,7 @@ namespace TypeSafeAI.Generated [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.ChoiceQuestion))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringObjectIListObjectObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf>), TypeInfoPropertyName = "AnyOfStringObjectIListObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.HTTPValidationError))] @@ -73,7 +73,6 @@ namespace TypeSafeAI.Generated [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.ScoreQuestion))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.QuestionDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.QuestionDiscriminatorType), TypeInfoPropertyName = "QuestionDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf>), TypeInfoPropertyName = "AnyOfStringObjectIListObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.SystemOneRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] @@ -83,10 +82,9 @@ namespace TypeSafeAI.Generated [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf, object>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs index 6943826..875863f 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs @@ -73,7 +73,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::TypeSafeAI.Generated.AnyOf, object>? Type10 { get; set; } + public global::TypeSafeAI.Generated.AnyOf>? Type10 { get; set; } /// /// /// @@ -133,48 +133,44 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::TypeSafeAI.Generated.AnyOf>? Type25 { get; set; } + public global::System.Collections.Generic.IList>>? Type25 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>>? Type26 { get; set; } + public global::TypeSafeAI.Generated.SystemOneRequest? Type26 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.SystemOneRequest? Type27 { get; set; } + public global::System.Collections.Generic.Dictionary? Type27 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type28 { get; set; } + public global::TypeSafeAI.Generated.SystemOneResponse? Type28 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.SystemOneResponse? Type29 { get; set; } + public global::System.Collections.Generic.Dictionary? Type29 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type30 { get; set; } + public global::TypeSafeAI.Generated.Usage? Type30 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.Usage? Type31 { get; set; } + public int? Type31 { get; set; } /// /// /// - public int? Type32 { get; set; } + public global::System.Collections.Generic.IList>? Type32 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type33 { get; set; } - /// - /// - /// - public global::TypeSafeAI.Generated.AnyOf? Type34 { get; set; } + public global::TypeSafeAI.Generated.AnyOf? Type33 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.AnyOf, object>? ListType0 { get; set; } + public global::TypeSafeAI.Generated.AnyOf>? ListType0 { get; set; } /// /// /// @@ -190,14 +186,10 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::TypeSafeAI.Generated.AnyOf>? ListType4 { get; set; } - /// - /// - /// - public global::System.Collections.Generic.List>>? ListType5 { get; set; } + public global::System.Collections.Generic.List>>? ListType4 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType6 { get; set; } + public global::System.Collections.Generic.List>? ListType5 { get; set; } } } \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ChoiceQuestion.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ChoiceQuestion.g.cs index fc3f8ba..4057b2a 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ChoiceQuestion.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ChoiceQuestion.g.cs @@ -19,8 +19,8 @@ public sealed partial class ChoiceQuestion /// What the model should decide when choosing an option. /// [global::System.Text.Json.Serialization.JsonPropertyName("instructions")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>))] - public global::TypeSafeAI.Generated.AnyOf, object>? Instructions { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>))] + public global::TypeSafeAI.Generated.AnyOf>? Instructions { get; set; } /// /// Choice names and descriptions of when each applies. A choice without a description is interpreted by its name alone. @@ -52,7 +52,7 @@ public sealed partial class ChoiceQuestion #endif public ChoiceQuestion( object criteria, - global::TypeSafeAI.Generated.AnyOf, object>? instructions, + global::TypeSafeAI.Generated.AnyOf>? instructions, string type = "choice") { this.Type = type; diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulCriteria.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulCriteria.g.cs index 9726259..1f9559c 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulCriteria.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulCriteria.g.cs @@ -12,15 +12,15 @@ public sealed partial class NoulCriteria /// What counts as a yes answer. /// [global::System.Text.Json.Serialization.JsonPropertyName("true")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>))] - public global::TypeSafeAI.Generated.AnyOf, object>? True { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>))] + public global::TypeSafeAI.Generated.AnyOf>? True { get; set; } /// /// What counts as a no answer. /// [global::System.Text.Json.Serialization.JsonPropertyName("false")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>))] - public global::TypeSafeAI.Generated.AnyOf, object>? False { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>))] + public global::TypeSafeAI.Generated.AnyOf>? False { get; set; } /// /// Raw JSON properties that are not explicitly defined in the schema @@ -41,8 +41,8 @@ public sealed partial class NoulCriteria [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NoulCriteria( - global::TypeSafeAI.Generated.AnyOf, object>? @true, - global::TypeSafeAI.Generated.AnyOf, object>? @false) + global::TypeSafeAI.Generated.AnyOf>? @true, + global::TypeSafeAI.Generated.AnyOf>? @false) { this.True = @true; this.False = @false; diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulQuestion.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulQuestion.g.cs index e520392..80adbe1 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulQuestion.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.NoulQuestion.g.cs @@ -19,8 +19,8 @@ public sealed partial class NoulQuestion /// The yes/no question or statement to evaluate. /// [global::System.Text.Json.Serialization.JsonPropertyName("instructions")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>))] - public global::TypeSafeAI.Generated.AnyOf, object>? Instructions { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>))] + public global::TypeSafeAI.Generated.AnyOf>? Instructions { get; set; } /// /// Criteria clarifying what counts as a yes or no answer. @@ -50,7 +50,7 @@ public sealed partial class NoulQuestion [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NoulQuestion( - global::TypeSafeAI.Generated.AnyOf, object>? instructions, + global::TypeSafeAI.Generated.AnyOf>? instructions, global::TypeSafeAI.Generated.NoulCriteria? criteria, string type = "noul") { diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ScoreQuestion.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ScoreQuestion.g.cs index 84715fb..39cbe26 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ScoreQuestion.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.ScoreQuestion.g.cs @@ -19,8 +19,8 @@ public sealed partial class ScoreQuestion /// What the model should rate. /// [global::System.Text.Json.Serialization.JsonPropertyName("instructions")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter, object>))] - public global::TypeSafeAI.Generated.AnyOf, object>? Instructions { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>))] + public global::TypeSafeAI.Generated.AnyOf>? Instructions { get; set; } /// /// Ordered descriptions of the score levels. Each description's position determines its score, starting at zero. @@ -52,7 +52,7 @@ public sealed partial class ScoreQuestion #endif public ScoreQuestion( global::System.Collections.Generic.IList>> criteria, - global::TypeSafeAI.Generated.AnyOf, object>? instructions, + global::TypeSafeAI.Generated.AnyOf>? instructions, string type = "score") { this.Type = type;