mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
Switch to scalar for swagger-ui generation (#3391)
This commit is contained in:
committed by
GitHub
parent
77c802ee5f
commit
65c7a60c92
@@ -15,8 +15,8 @@
|
||||
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
|
||||
<PackageReference Include="Nito.AsyncEx.Coordination" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" />
|
||||
<PackageReference Include="Scalar.AspNetCore" />
|
||||
<PackageReference Include="SteamKit2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" />
|
||||
<PackageReference Include="System.Composition" />
|
||||
<PackageReference Include="System.Linq.Async" />
|
||||
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
|
||||
|
||||
@@ -54,6 +54,7 @@ using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
using NLog.Web;
|
||||
using Scalar.AspNetCore;
|
||||
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
|
||||
|
||||
namespace ArchiSteamFarm.IPC;
|
||||
@@ -258,14 +259,12 @@ internal static class ArchiKestrel {
|
||||
app.MapOpenApi("/swagger/{documentName}/swagger.json");
|
||||
|
||||
// Add support for swagger UI, this should be after swagger, obviously
|
||||
app.UseSwaggerUI(
|
||||
static options => {
|
||||
options.DisplayRequestDuration();
|
||||
options.EnableDeepLinking();
|
||||
options.EnableTryItOutByDefault();
|
||||
options.ShowCommonExtensions();
|
||||
options.ShowExtensions();
|
||||
options.SwaggerEndpoint($"{SharedInfo.ASF}/swagger.json", $"{SharedInfo.ASF} API");
|
||||
app.MapScalarApiReference(
|
||||
"/swagger", static options => {
|
||||
options.DefaultFonts = false;
|
||||
options.OpenApiRoutePattern = $"/swagger/{SharedInfo.ASF}/swagger.json";
|
||||
options.Theme = ScalarTheme.Kepler;
|
||||
options.Title = $"{SharedInfo.AssemblyName} API";
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.11.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.11.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.11.1" />
|
||||
<PackageVersion Include="Scalar.AspNetCore" Version="2.0.21" />
|
||||
<PackageVersion Include="SteamKit2" Version="3.0.2" />
|
||||
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.3.2" />
|
||||
<PackageVersion Include="System.Composition" Version="9.0.3" />
|
||||
<PackageVersion Include="System.Composition.AttributedModel" Version="9.0.3" />
|
||||
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
|
||||
|
||||
Reference in New Issue
Block a user