-
Notifications
You must be signed in to change notification settings - Fork 0
Update NuGet packages and fix build warnings #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| using Asp.Versioning.ApiExplorer; | ||
| using Microsoft.AspNetCore.Authentication.JwtBearer; | ||
| using Microsoft.Extensions.Options; | ||
| using Microsoft.OpenApi.Models; | ||
| using Microsoft.OpenApi; | ||
| using Swashbuckle.AspNetCore.SwaggerGen; | ||
|
|
||
| namespace ResidencyRoll.Api.Configuration; | ||
|
|
@@ -36,18 +36,11 @@ public void Configure(SwaggerGenOptions options) | |
| Description = "JWT Authorization header using the Bearer scheme" | ||
| }); | ||
|
|
||
| options.AddSecurityRequirement(new OpenApiSecurityRequirement | ||
| options.AddSecurityRequirement(document => new OpenApiSecurityRequirement | ||
| { | ||
| { | ||
| new OpenApiSecurityScheme | ||
| { | ||
| Reference = new OpenApiReference | ||
| { | ||
| Type = ReferenceType.SecurityScheme, | ||
| Id = "Bearer" | ||
| } | ||
| }, | ||
| Array.Empty<string>() | ||
| new OpenApiSecuritySchemeReference("Bearer", document, null), | ||
|
||
| new List<string>() | ||
| } | ||
| }); | ||
|
Comment on lines
+39
to
45
|
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The namespace change from
Microsoft.OpenApi.ModelstoMicrosoft.OpenApiis incorrect. The types used in this file (OpenApiInfo, OpenApiSecurityScheme, SecuritySchemeType, ParameterLocation, OpenApiSecurityRequirement) are located in theMicrosoft.OpenApi.Modelsnamespace, not the rootMicrosoft.OpenApinamespace. This will cause compilation errors. The using statement should beusing Microsoft.OpenApi.Models;to maintain access to these types.