diff --git a/src/cli/AsyncAI.CLI/CliRuntime.cs b/src/cli/AsyncAI.CLI/CliRuntime.cs index 44a1dc0..087edaf 100644 --- a/src/cli/AsyncAI.CLI/CliRuntime.cs +++ b/src/cli/AsyncAI.CLI/CliRuntime.cs @@ -387,7 +387,13 @@ public static string SerializeKeyValuePairs(IEnumerable pairs) public static string SerializeStringArray(IEnumerable values) { - return JsonSerializer.Serialize(values.ToArray()); + var array = new JsonArray(); + foreach (var value in values) + { + array.Add((JsonNode?)JsonValue.Create(value)); + } + + return array.ToJsonString(); } public static async global::System.Threading.Tasks.Task WriteJsonAsync(ParseResult parseResult, T value, JsonSerializerContext context, CancellationToken cancellationToken = default) diff --git a/src/libs/AsyncAI/Generated/AsyncAI.ApiStatusClient.g.cs b/src/libs/AsyncAI/Generated/AsyncAI.ApiStatusClient.g.cs index 39ea428..6b2fe71 100644 --- a/src/libs/AsyncAI/Generated/AsyncAI.ApiStatusClient.g.cs +++ b/src/libs/AsyncAI/Generated/AsyncAI.ApiStatusClient.g.cs @@ -34,14 +34,14 @@ public sealed partial class ApiStatusClient : global::AsyncAI.IApiStatusClient, /// public global::AsyncAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::AsyncAI.ApiStatusSourceGenerationContext.Default); + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } /// /// /// public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { - get => JsonSerializerContextProvider.Value; + get => JsonSerializerContextProvider?.Value ?? global::AsyncAI.ApiStatusSourceGenerationContext.Default; set => JsonSerializerContextProvider = new(() => value); } diff --git a/src/libs/AsyncAI/Generated/AsyncAI.AsyncAIClient.g.cs b/src/libs/AsyncAI/Generated/AsyncAI.AsyncAIClient.g.cs index 4be8d9f..7e7ede6 100644 --- a/src/libs/AsyncAI/Generated/AsyncAI.AsyncAIClient.g.cs +++ b/src/libs/AsyncAI/Generated/AsyncAI.AsyncAIClient.g.cs @@ -35,14 +35,14 @@ public sealed partial class AsyncAIClient : global::AsyncAI.IAsyncAIClient, glob /// public global::AsyncAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::AsyncAI.SourceGenerationContext.Default); + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } /// /// /// public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { - get => JsonSerializerContextProvider.Value; + get => JsonSerializerContextProvider?.Value ?? global::AsyncAI.SourceGenerationContext.Default; set => JsonSerializerContextProvider = new(() => value); } diff --git a/src/libs/AsyncAI/Generated/AsyncAI.TextToSpeechClient.g.cs b/src/libs/AsyncAI/Generated/AsyncAI.TextToSpeechClient.g.cs index 1926174..bbbbd85 100644 --- a/src/libs/AsyncAI/Generated/AsyncAI.TextToSpeechClient.g.cs +++ b/src/libs/AsyncAI/Generated/AsyncAI.TextToSpeechClient.g.cs @@ -34,14 +34,14 @@ public sealed partial class TextToSpeechClient : global::AsyncAI.ITextToSpeechCl /// public global::AsyncAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::AsyncAI.SourceGenerationContext.Default); + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } /// /// /// public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { - get => JsonSerializerContextProvider.Value; + get => JsonSerializerContextProvider?.Value ?? global::AsyncAI.SourceGenerationContext.Default; set => JsonSerializerContextProvider = new(() => value); } diff --git a/src/libs/AsyncAI/Generated/AsyncAI.VoiceManagementClient.g.cs b/src/libs/AsyncAI/Generated/AsyncAI.VoiceManagementClient.g.cs index db42c64..36e0b26 100644 --- a/src/libs/AsyncAI/Generated/AsyncAI.VoiceManagementClient.g.cs +++ b/src/libs/AsyncAI/Generated/AsyncAI.VoiceManagementClient.g.cs @@ -34,14 +34,14 @@ public sealed partial class VoiceManagementClient : global::AsyncAI.IVoiceManage /// public global::AsyncAI.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::AsyncAI.SourceGenerationContext.Default); + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } /// /// /// public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { - get => JsonSerializerContextProvider.Value; + get => JsonSerializerContextProvider?.Value ?? global::AsyncAI.SourceGenerationContext.Default; set => JsonSerializerContextProvider = new(() => value); }