Skip to content

Commit

Permalink
Show newest API versions first in Swagger UI (#1257)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Apr 3, 2024
1 parent 606294e commit fb9cf48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> 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);
Expand Down
16 changes: 8 additions & 8 deletions TeachingRecordSystem/src/TeachingRecordSystem.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb9cf48

Please sign in to comment.