fix(api): migrate OpenAPI types for Swashbuckle 10

This commit is contained in:
Adam Moussa 2026-08-25 12:01:17 -04:00
parent f59a70f3f3
commit 6ff48dea61
No known key found for this signature in database

View file

@ -8,7 +8,7 @@ using FluentValidation;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi;
using ProposalSystem.Api.Middleware; using ProposalSystem.Api.Middleware;
using ProposalSystem.Api.Services; using ProposalSystem.Api.Services;
using ProposalSystem.Application.Interfaces; using ProposalSystem.Application.Interfaces;
@ -186,15 +186,9 @@ builder.Services.AddSwaggerGen(options =>
In = ParameterLocation.Header, In = ParameterLocation.Header,
Description = "Cognito JWT access token", Description = "Cognito JWT access token",
}); });
options.AddSecurityRequirement(new OpenApiSecurityRequirement options.AddSecurityRequirement(document => new OpenApiSecurityRequirement
{ {
{ [new OpenApiSecuritySchemeReference("Bearer", document)] = [],
new OpenApiSecurityScheme
{
Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" },
},
Array.Empty<string>()
},
}); });
}); });