From 4e8d779555d0b0497e44677ff5503f356008d513 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Nov 2024 18:28:28 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...ngFace.HuggingFaceClient.GenerateText.g.cs | 6 ++--- .../HuggingFace.Models.ErrorResponse.g.cs | 2 +- .../JsonConverters.AnyOfFactory2.g.cs | 25 ------------------- .../Generated/JsonSerializerContext.g.cs | 2 +- 4 files changed, 4 insertions(+), 31 deletions(-) delete mode 100644 src/libs/HuggingFace/Generated/JsonConverters.AnyOfFactory2.g.cs diff --git a/src/libs/HuggingFace/Generated/HuggingFace.HuggingFaceClient.GenerateText.g.cs b/src/libs/HuggingFace/Generated/HuggingFace.HuggingFaceClient.GenerateText.g.cs index 7eeda2b..f9ec2f8 100644 --- a/src/libs/HuggingFace/Generated/HuggingFace.HuggingFaceClient.GenerateText.g.cs +++ b/src/libs/HuggingFace/Generated/HuggingFace.HuggingFaceClient.GenerateText.g.cs @@ -151,12 +151,10 @@ partial void ProcessGenerateTextResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList; + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/HuggingFace/Generated/HuggingFace.Models.ErrorResponse.g.cs b/src/libs/HuggingFace/Generated/HuggingFace.Models.ErrorResponse.g.cs index d440b52..e6803a6 100644 --- a/src/libs/HuggingFace/Generated/HuggingFace.Models.ErrorResponse.g.cs +++ b/src/libs/HuggingFace/Generated/HuggingFace.Models.ErrorResponse.g.cs @@ -14,7 +14,7 @@ public sealed partial class ErrorResponse /// /// [global::System.Text.Json.Serialization.JsonPropertyName("error")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::HuggingFace.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::HuggingFace.JsonConverters.AnyOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] public required global::HuggingFace.AnyOf> Error { get; set; } diff --git a/src/libs/HuggingFace/Generated/JsonConverters.AnyOfFactory2.g.cs b/src/libs/HuggingFace/Generated/JsonConverters.AnyOfFactory2.g.cs deleted file mode 100644 index bec7c47..0000000 --- a/src/libs/HuggingFace/Generated/JsonConverters.AnyOfFactory2.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace HuggingFace.JsonConverters -{ - /// - public sealed class AnyOfJsonConverterFactory2 : global::System.Text.Json.Serialization.JsonConverterFactory - { - /// - public override bool CanConvert(global::System.Type? typeToConvert) - { - return typeToConvert is { IsGenericType: true } && typeToConvert.GetGenericTypeDefinition() == typeof(global::HuggingFace.AnyOf<,>); - } - - /// - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - typeToConvert = typeToConvert ?? throw new global::System.ArgumentNullException(nameof(typeToConvert)); - - return (global::System.Text.Json.Serialization.JsonConverter)global::System.Activator.CreateInstance( - typeof(AnyOfJsonConverter<,>).MakeGenericType(typeToConvert.GenericTypeArguments))!; - } - } -} diff --git a/src/libs/HuggingFace/Generated/JsonSerializerContext.g.cs b/src/libs/HuggingFace/Generated/JsonSerializerContext.g.cs index c5ae81d..45ee00d 100644 --- a/src/libs/HuggingFace/Generated/JsonSerializerContext.g.cs +++ b/src/libs/HuggingFace/Generated/JsonSerializerContext.g.cs @@ -13,7 +13,7 @@ namespace HuggingFace DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { - typeof(global::HuggingFace.JsonConverters.AnyOfJsonConverterFactory2), + typeof(global::HuggingFace.JsonConverters.AnyOfJsonConverter>), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::HuggingFace.JsonSerializerContextTypes))]