From 0d82dff3b2962e8f87548b39c1fa48fa215de5ec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 28 Sep 2026 09:06:50 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- src/cli/ImagineArt.CLI/CliRuntime.cs | 7 ++++--- .../ImagineArt.JsonSerializerContext.g.cs | 5 ++--- .../Generated/ImagineArt.OptionsSupport.g.cs | 15 ++++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/cli/ImagineArt.CLI/CliRuntime.cs b/src/cli/ImagineArt.CLI/CliRuntime.cs index 87f4b25..d28d0b1 100644 --- a/src/cli/ImagineArt.CLI/CliRuntime.cs +++ b/src/cli/ImagineArt.CLI/CliRuntime.cs @@ -355,9 +355,10 @@ public static TimeSpan ParseDuration(string value, string optionName) public static T DeserializeJsonValue(string json, JsonSerializerContext context) { - _ = context; - return JsonSerializer.Deserialize(json) ?? - throw new CliException($"Unable to deserialize generated CLI value as {typeof(T).Name}."); + var value = JsonSerializer.Deserialize(json, typeof(T), context); + return value is T typed + ? typed + : throw new CliException($"Unable to deserialize generated CLI value as {typeof(T).Name}."); } public static string SerializeKeyValuePairs(IEnumerable pairs) diff --git a/src/libs/ImagineArt/Generated/ImagineArt.JsonSerializerContext.g.cs b/src/libs/ImagineArt/Generated/ImagineArt.JsonSerializerContext.g.cs index e06b8e8..b020814 100644 --- a/src/libs/ImagineArt/Generated/ImagineArt.JsonSerializerContext.g.cs +++ b/src/libs/ImagineArt/Generated/ImagineArt.JsonSerializerContext.g.cs @@ -1,14 +1,12 @@ #nullable enable -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant - namespace ImagineArt { /// /// /// + #pragma warning disable CS3016 // Converter type array in this attribute is not CLS-compliant. [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] @@ -23,6 +21,7 @@ namespace ImagineArt typeof(global::ImagineArt.JsonConverters.UnixTimestampJsonConverter), })] + #pragma warning restore CS3016 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ImagineArt.JsonSerializerContextTypes))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ImagineArt.GenerateImageRequest))] diff --git a/src/libs/ImagineArt/Generated/ImagineArt.OptionsSupport.g.cs b/src/libs/ImagineArt/Generated/ImagineArt.OptionsSupport.g.cs index c376296..c8592cc 100644 --- a/src/libs/ImagineArt/Generated/ImagineArt.OptionsSupport.g.cs +++ b/src/libs/ImagineArt/Generated/ImagineArt.OptionsSupport.g.cs @@ -241,7 +241,8 @@ public sealed class AutoSDKAuthorizationProviderHook : global::ImagineArt.AutoSD { context = context ?? throw new global::System.ArgumentNullException(nameof(context)); - if (context.Request == null) + var request = context.Request; + if (request == null) { return; } @@ -251,10 +252,10 @@ public sealed class AutoSDKAuthorizationProviderHook : global::ImagineArt.AutoSD { for (var index = 0; index < perRequest.Count; index++) { - ApplyAuthorization(context.Request, perRequest[index]); + ApplyAuthorization(request, perRequest[index]); } - global::ImagineArt.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + global::ImagineArt.AutoSDKHttpRequestOptions.StampAuthorizationOverride(request); return; } @@ -272,10 +273,10 @@ public sealed class AutoSDKAuthorizationProviderHook : global::ImagineArt.AutoSD for (var index = 0; index < resolved.Count; index++) { - ApplyAuthorization(context.Request, resolved[index]); + ApplyAuthorization(request, resolved[index]); } - global::ImagineArt.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + global::ImagineArt.AutoSDKHttpRequestOptions.StampAuthorizationOverride(request); } private static void ApplyAuthorization( @@ -486,7 +487,7 @@ public sealed class AutoSDKHookContext /// /// The outgoing HTTP request for the current attempt. /// - public global::System.Net.Http.HttpRequestMessage Request { get; set; } = null!; + public global::System.Net.Http.HttpRequestMessage? Request { get; set; } /// /// The HTTP response when one was received. @@ -501,7 +502,7 @@ public sealed class AutoSDKHookContext /// /// The client-wide runtime options. /// - public global::ImagineArt.AutoSDKClientOptions ClientOptions { get; set; } = null!; + public global::ImagineArt.AutoSDKClientOptions? ClientOptions { get; set; } /// /// The per-request runtime options.