From 6ff48dea61bba0c42fdaefe2c9a5bb73c5e54c83 Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Tue, 25 Aug 2026 12:01:17 -0400 Subject: [PATCH] fix(api): migrate OpenAPI types for Swashbuckle 10 --- api/src/ProposalSystem.Api/Program.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/api/src/ProposalSystem.Api/Program.cs b/api/src/ProposalSystem.Api/Program.cs index 0fac998..2281d41 100644 --- a/api/src/ProposalSystem.Api/Program.cs +++ b/api/src/ProposalSystem.Api/Program.cs @@ -8,7 +8,7 @@ using FluentValidation; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.EntityFrameworkCore; using Microsoft.IdentityModel.Tokens; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using ProposalSystem.Api.Middleware; using ProposalSystem.Api.Services; using ProposalSystem.Application.Interfaces; @@ -186,15 +186,9 @@ builder.Services.AddSwaggerGen(options => In = ParameterLocation.Header, Description = "Cognito JWT access token", }); - options.AddSecurityRequirement(new OpenApiSecurityRequirement + options.AddSecurityRequirement(document => new OpenApiSecurityRequirement { - { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" }, - }, - Array.Empty() - }, + [new OpenApiSecuritySchemeReference("Bearer", document)] = [], }); });