mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
* Update to .NET 10 * Use classic linker * Attempt * Again * Again * Again * Again * Again * again * macos 14 * Remove extra csproj changes
20 lines
601 B
C#
20 lines
601 B
C#
using Microsoft.AspNetCore.OpenApi;
|
|
using Microsoft.OpenApi;
|
|
|
|
namespace AssetRipper.GUI.Web.Documentation;
|
|
|
|
internal class SortDocumentPathsTransformer : IOpenApiDocumentTransformer
|
|
{
|
|
public Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken)
|
|
{
|
|
OpenApiPaths newPaths = new();
|
|
newPaths.Extensions = document.Paths.Extensions;
|
|
foreach ((string key, IOpenApiPathItem value) in document.Paths.OrderBy(pair => pair.Key))
|
|
{
|
|
newPaths.Add(key, value);
|
|
}
|
|
document.Paths = newPaths;
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|