From bc1700777772e644f19b1cddb321079a17d6d49d Mon Sep 17 00:00:00 2001 From: Laura Neto <12862535+lauraneto@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:38:42 +0100 Subject: [PATCH] Use AddComponent for OpenAPI security scheme registration Fixes security requirements being serialized as empty objects in the OpenAPI document by using the document's AddComponent method instead of directly manipulating the SecuritySchemes dictionary. --- ...UmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions.cs b/src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions.cs index 59227684623b..4ba3031a8578 100644 --- a/src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions.cs +++ b/src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions.cs @@ -47,9 +47,7 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) return; } - swaggerDoc.Components ??= new OpenApiComponents(); - swaggerDoc.Components.SecuritySchemes ??= new Dictionary(); - swaggerDoc.Components.SecuritySchemes.Add( + swaggerDoc.AddComponent( AuthSchemeName, new OpenApiSecurityScheme {