From ce95d6f2d532fa650aa20d46c57101e1d8fb2d6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 17 Jun 2026 15:54:39 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- src/cli/Pruna.CLI/CliRuntime.cs | 38 ++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/cli/Pruna.CLI/CliRuntime.cs b/src/cli/Pruna.CLI/CliRuntime.cs index fbab14a..f15c637 100644 --- a/src/cli/Pruna.CLI/CliRuntime.cs +++ b/src/cli/Pruna.CLI/CliRuntime.cs @@ -24,14 +24,12 @@ internal static class CliRuntime ? new global::System.Collections.Generic.List() : new global::System.Collections.Generic.List { - new global::Pruna.EndPointAuthorization - { - Type = "ApiKey", - SchemeId = "ApikeyApikey", - Location = "Header", - Name = "apikey", - Value = apiKey, - }, + CreateAuthorization( + type: "ApiKey", + schemeId: "ApikeyApikey", + location: "Header", + name: "apikey", + value: apiKey), }; var baseUri = ResolveBaseUri(parseResult); @@ -42,6 +40,30 @@ internal static class CliRuntime disposeHttpClient: true); } + private static global::Pruna.EndPointAuthorization CreateAuthorization( + string type, + string schemeId, + string location, + string name, + string value) + { + var authorization = new global::Pruna.EndPointAuthorization + { + Type = type, + Location = location, + Name = name, + Value = value, + }; + + var schemeIdProperty = typeof(global::Pruna.EndPointAuthorization).GetProperty("SchemeId"); + if (schemeIdProperty?.CanWrite == true) + { + schemeIdProperty.SetValue(authorization, schemeId); + } + + return authorization; + } + [System.Diagnostics.CodeAnalysis.SuppressMessage( "Design", "CA1031:Do not catch general exception types",