From d7e0515058d1509c3ed0da0dd0d309e3cedf0386 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 29 Aug 2026 06:56:52 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...HT.JsonConverters.StreamSpeechRequest.g.cs | 138 +++++++----------- .../PlayHT.JsonSerializerContext.g.cs | 1 + .../PlayHT.JsonSerializerContextTypes.g.cs | 5 + 3 files changed, 55 insertions(+), 89 deletions(-) diff --git a/src/libs/PlayHT/Generated/PlayHT.JsonConverters.StreamSpeechRequest.g.cs b/src/libs/PlayHT/Generated/PlayHT.JsonConverters.StreamSpeechRequest.g.cs index 1e7c0e1..594e85f 100644 --- a/src/libs/PlayHT/Generated/PlayHT.JsonConverters.StreamSpeechRequest.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.JsonConverters.StreamSpeechRequest.g.cs @@ -17,102 +17,34 @@ public class StreamSpeechRequestJsonConverter : global::System.Text.Json.Seriali 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); - } + global::PlayHT.CreateSpeechRequest? create = default; + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.CreateSpeechRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.CreateSpeechRequest).Name}"); + create = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { } - var __score0 = 0; - if (__jsonProps.Contains("language")) __score0++; - if (__jsonProps.Contains("model")) __score0++; - if (__jsonProps.Contains("output_format")) __score0++; - if (__jsonProps.Contains("speed")) __score0++; - if (__jsonProps.Contains("temperature")) __score0++; - if (__jsonProps.Contains("text")) __score0++; - if (__jsonProps.Contains("voice")) __score0++; - if (__jsonProps.Contains("voice_engine")) __score0++; - var __score1 = 0; - if (__jsonProps.Contains("request_id")) __score1++; - var __bestScore = 0; - var __bestIndex = -1; - if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } - if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } - - global::PlayHT.CreateSpeechRequest? create = default; global::PlayHT.StreamSpeechRequestVariant2? streamSpeechRequestVariant2 = default; - if (__bestIndex >= 0) + try { - if (__bestIndex == 0) - { - try - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.CreateSpeechRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.CreateSpeechRequest).Name}"); - create = 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(global::PlayHT.StreamSpeechRequestVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.StreamSpeechRequestVariant2).Name}"); - streamSpeechRequestVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.StreamSpeechRequestVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.StreamSpeechRequestVariant2).Name}"); + streamSpeechRequestVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); } - - if (create == null && streamSpeechRequestVariant2 == null) + catch (global::System.Text.Json.JsonException) { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.CreateSpeechRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.CreateSpeechRequest).Name}"); - create = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } } - - if (create == null && streamSpeechRequestVariant2 == null) + catch (global::System.InvalidOperationException) { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.StreamSpeechRequestVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.StreamSpeechRequestVariant2).Name}"); - streamSpeechRequestVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } } - var __value = new global::PlayHT.StreamSpeechRequest( create, @@ -131,18 +63,46 @@ public override void Write( options = options ?? throw new global::System.ArgumentNullException(nameof(options)); var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + writer.WriteStartObject(); + var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal); if (value.IsCreate) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.CreateSpeechRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.CreateSpeechRequest).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Create!, typeInfo); + var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Create!, typeInfo); + if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object) + { + throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects."); + } + + foreach (var __property in __element0.EnumerateObject()) + { + if (__writtenPropertyNames.Add(__property.Name)) + { + __property.WriteTo(writer); + } + } } - else if (value.IsStreamSpeechRequestVariant2) + if (value.IsStreamSpeechRequestVariant2) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.StreamSpeechRequestVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.StreamSpeechRequestVariant2).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.StreamSpeechRequestVariant2!, typeInfo); + var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.StreamSpeechRequestVariant2!, typeInfo); + if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object) + { + throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects."); + } + + foreach (var __property in __element1.EnumerateObject()) + { + if (__writtenPropertyNames.Add(__property.Name)) + { + __property.WriteTo(writer); + } + } } + writer.WriteEndObject(); } } } \ No newline at end of file diff --git a/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContext.g.cs b/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContext.g.cs index d861009..3cd6d3d 100644 --- a/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContext.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContext.g.cs @@ -28,6 +28,7 @@ namespace PlayHT typeof(global::PlayHT.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PlayHT.JsonSerializerContextTypes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PlayHT.OutputFormat), TypeInfoPropertyName = "OutputFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PlayHT.TtsModel), TypeInfoPropertyName = "TtsModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PlayHT.CreateSpeechRequest))] diff --git a/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContextTypes.g.cs b/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContextTypes.g.cs index b90a02a..5d11829 100644 --- a/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContextTypes.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.JsonSerializerContextTypes.g.cs @@ -20,6 +20,11 @@ public sealed partial class JsonSerializerContextTypes /// public global::System.Collections.Generic.Dictionary? StringObjectDictionary { get; set; } + /// + /// Runtime object lists used by dynamic JSON payloads such as tool arguments. + /// + public global::System.Collections.Generic.List? ObjectList { get; set; } + /// /// ///