Skip to content

Commit eeb0af9

Browse files
committed
OpenApi fix
1 parent 5883cd1 commit eeb0af9

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/KeeperData.Bridge/Setup/ServiceCollectionExtensions.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Microsoft.AspNetCore.Authorization;
2020
using Microsoft.AspNetCore.Mvc.Authorization;
2121
using Microsoft.Extensions.Diagnostics.HealthChecks;
22-
using Microsoft.OpenApi.Models;
22+
using Microsoft.OpenApi;
2323
using System.Diagnostics.CodeAnalysis;
2424
using System.Reflection;
2525
using System.Text.Encodings.Web;
@@ -125,18 +125,11 @@ private static void ConfigureSwagger(this IServiceCollection services, IConfigur
125125
Scheme = "ApiKeyScheme"
126126
});
127127

128-
options.AddSecurityRequirement(new OpenApiSecurityRequirement
128+
options.AddSecurityRequirement(_ => new OpenApiSecurityRequirement
129129
{
130130
{
131-
new OpenApiSecurityScheme
132-
{
133-
Reference = new OpenApiReference
134-
{
135-
Type = ReferenceType.SecurityScheme,
136-
Id = "ApiKey"
137-
}
138-
},
139-
Array.Empty<string>()
131+
new OpenApiSecuritySchemeReference("ApiKey"),
132+
new List<string>()
140133
}
141134
});
142135
}

0 commit comments

Comments
 (0)