Make sure swagger tags and operations are sorted alphabetically (#13055)

This commit is contained in:
Kenn Jacobsen
2022-09-24 09:50:32 +02:00
committed by GitHub
parent c903c8a1a0
commit e1d438701b
2 changed files with 14 additions and 8 deletions

View File

@@ -52,6 +52,10 @@ public class ManagementApiComposer : IComposer
options.Version = ApiAllName;
options.DocumentName = ApiAllName;
options.Description = "This shows all APIs available in this version of Umbraco - Including all the legacy apis that is available for backward compatibility";
options.PostProcess = document =>
{
document.Tags = document.Tags.OrderBy(tag => tag.Name).ToList();
};
});
services.AddVersionedApiExplorer(options =>
@@ -113,6 +117,8 @@ public class ManagementApiComposer : IComposer
config.SwaggerRoutes.Clear();
var swaggerPath = $"{officePath}/swagger/{ApiAllName}/swagger.json";
config.SwaggerRoutes.Add(new SwaggerUi3Route(ApiAllName, swaggerPath));
config.OperationsSorter = "alpha";
config.TagsSorter = "alpha";
});
}
},

View File

@@ -628,19 +628,19 @@
},
"tags": [
{
"name": "Upgrade"
},
{
"name": "Server"
},
{
"name": "PublishedCache"
"name": "Install"
},
{
"name": "Profiling"
},
{
"name": "Install"
"name": "PublishedCache"
},
{
"name": "Server"
},
{
"name": "Upgrade"
}
]
}