add support for custom doc css

This commit is contained in:
crobibero 2020-08-18 15:52:42 -06:00
parent 93fe595e5e
commit 1d9285c594
5 changed files with 12 additions and 0 deletions

View File

@ -38,12 +38,14 @@ namespace Jellyfin.Server.Extensions
c.DocumentTitle = "Jellyfin API";
c.SwaggerEndpoint($"/{baseUrl}api-docs/openapi.json", "Jellyfin API");
c.RoutePrefix = $"{baseUrl}api-docs/swagger";
c.InjectStylesheet($"/{baseUrl}api-docs/swagger/custom.css");
})
.UseReDoc(c =>
{
c.DocumentTitle = "Jellyfin API";
c.SpecUrl($"/{baseUrl}api-docs/openapi.json");
c.RoutePrefix = $"{baseUrl}api-docs/redoc";
c.InjectStylesheet($"/{baseUrl}api-docs/redoc/custom.css");
});
}
}

View File

@ -63,4 +63,13 @@
<ProjectReference Include="..\Jellyfin.Server.Implementations\Jellyfin.Server.Implementations.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="wwwroot\api-docs\swagger\custom.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="wwwroot\api-docs\redoc\custom.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -73,6 +73,7 @@ namespace Jellyfin.Server
// TODO app.UseMiddleware<WebSocketMiddleware>();
app.UseStaticFiles();
app.UseAuthentication();
app.UseJellyfinApiSwagger(_serverConfigurationManager);
app.UseRouting();