diff --git a/backend/UniVerse.Api/Controllers/LecturesController.cs b/backend/UniVerse.Api/Controllers/LecturesController.cs index f1dc2a1..cd201ff 100644 --- a/backend/UniVerse.Api/Controllers/LecturesController.cs +++ b/backend/UniVerse.Api/Controllers/LecturesController.cs @@ -61,4 +61,5 @@ public class LecturesController : ControllerBase [HttpGet("{id:int}/reviews")] public async Task Reviews(int id, [FromQuery] PaginationRequest pagination) => Ok(await _reviews.GetByLectureAsync(id, pagination)); + } diff --git a/backend/UniVerse.Api/Controllers/SyncController.cs b/backend/UniVerse.Api/Controllers/SyncController.cs index 67bbaac..51754a0 100644 --- a/backend/UniVerse.Api/Controllers/SyncController.cs +++ b/backend/UniVerse.Api/Controllers/SyncController.cs @@ -28,4 +28,5 @@ public class SyncController : ControllerBase [HttpPost("employees")] public async Task SearchEmployees([FromQuery] string fullname) => Ok(await _sync.SearchEmployeesAsync(fullname)); + } diff --git a/backend/UniVerse.Api/Program.cs b/backend/UniVerse.Api/Program.cs index 2658da9..4aeda3a 100644 --- a/backend/UniVerse.Api/Program.cs +++ b/backend/UniVerse.Api/Program.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.EntityFrameworkCore; using Microsoft.IdentityModel.Tokens; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Serilog; using UniVerse.Api.BackgroundServices; using UniVerse.Api.Middleware; @@ -127,15 +127,13 @@ builder.Services.AddSwaggerGen(options => Description = "Enter your JWT token" }); - options.AddSecurityRequirement(new OpenApiSecurityRequirement + options.AddSecurityRequirement(doc => { + var bearerSchemeRef = new OpenApiSecuritySchemeReference("Bearer", doc, externalResource: null); + return new OpenApiSecurityRequirement { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" } - }, - Array.Empty() - } + [bearerSchemeRef] = new List() + }; }); }); diff --git a/backend/UniVerse.Api/UniVerse.Api.csproj b/backend/UniVerse.Api/UniVerse.Api.csproj index 0a73ba0..592c48a 100644 --- a/backend/UniVerse.Api/UniVerse.Api.csproj +++ b/backend/UniVerse.Api/UniVerse.Api.csproj @@ -12,11 +12,11 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive all + +