diff --git a/src/cli/ModernMT.CLI/CliRuntime.cs b/src/cli/ModernMT.CLI/CliRuntime.cs index 2916c8f..e7abbe3 100644 --- a/src/cli/ModernMT.CLI/CliRuntime.cs +++ b/src/cli/ModernMT.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/ModernMT/Generated/ModernMT.ModernMTClient.g.cs b/src/libs/ModernMT/Generated/ModernMT.ModernMTClient.g.cs index 18b1b39..acca247 100644 --- a/src/libs/ModernMT/Generated/ModernMT.ModernMTClient.g.cs +++ b/src/libs/ModernMT/Generated/ModernMT.ModernMTClient.g.cs @@ -35,14 +35,14 @@ public sealed partial class ModernMTClient : global::ModernMT.IModernMTClient, g /// public global::ModernMT.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::ModernMT.SourceGenerationContext.Default); + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } /// /// /// public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { - get => JsonSerializerContextProvider.Value; + get => JsonSerializerContextProvider?.Value ?? global::ModernMT.SourceGenerationContext.Default; set => JsonSerializerContextProvider = new(() => value); }