diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/Infrastructure/OpenApi/ServiceCollectionExtensions.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/Infrastructure/OpenApi/ServiceCollectionExtensions.cs index 63448c9b9..bd0f71a69 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/Infrastructure/OpenApi/ServiceCollectionExtensions.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/Infrastructure/OpenApi/ServiceCollectionExtensions.cs @@ -92,7 +92,7 @@ public Action Configure(Action next) = app.UseSwaggerUI(options => { - foreach (var (version, minorVersion) in VersionRegistry.GetAllVersions(configuration)) + foreach (var (version, minorVersion) in VersionRegistry.GetAllVersions(configuration).Reverse()) { var documentName = OpenApiDocumentHelper.GetDocumentName(version, minorVersion); options.SwaggerEndpoint(OpenApiDocumentHelper.DocumentRouteTemplate.Replace("{documentName}", documentName), documentName); diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/Program.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/Program.cs index b8e3ad191..1ae74c1c1 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/Program.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/Program.cs @@ -134,16 +134,16 @@ public static void Main(string[] args) .RequireRole([ApiRoles.UnlockPerson])); options.AddPolicy( - AuthorizationPolicies.CreateTrn, - policy => policy - .AddAuthenticationSchemes(ApiKeyAuthenticationHandler.AuthenticationScheme) - .RequireRole([ApiRoles.CreateTrn])); + AuthorizationPolicies.CreateTrn, + policy => policy + .AddAuthenticationSchemes(ApiKeyAuthenticationHandler.AuthenticationScheme) + .RequireRole([ApiRoles.CreateTrn])); options.AddPolicy( - AuthorizationPolicies.AssignQtls, - policy => policy - .AddAuthenticationSchemes(ApiKeyAuthenticationHandler.AuthenticationScheme) - .RequireRole([ApiRoles.AssignQtls])); + AuthorizationPolicies.AssignQtls, + policy => policy + .AddAuthenticationSchemes(ApiKeyAuthenticationHandler.AuthenticationScheme) + .RequireRole([ApiRoles.AssignQtls])); }); services