The Free Software Media System - Server Backend & API
add support for custom doc css
crobibero1d9285c59443
diff --git a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.csindex 745567703f..c9539681b9 100644--- a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs+++ b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs@@ -38,12 +38,14 @@ namespace Jellyfin.Server.Extensionsc.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");});}}diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csprojindex 7541707d9f..88e4d41fbe 100644--- a/Jellyfin.Server/Jellyfin.Server.csproj+++ b/Jellyfin.Server/Jellyfin.Server.csproj@@ -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>diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.csindex 108d8f881e..c0ddd9af35 100644--- a/Jellyfin.Server/Startup.cs+++ b/Jellyfin.Server/Startup.cs@@ -73,6 +73,7 @@ namespace Jellyfin.Server// TODO app.UseMiddleware<WebSocketMiddleware>();+ app.UseStaticFiles();app.UseAuthentication();app.UseJellyfinApiSwagger(_serverConfigurationManager);app.UseRouting();diff --git a/Jellyfin.Server/wwwroot/api-docs/redoc/custom.css b/Jellyfin.Server/wwwroot/api-docs/redoc/custom.cssnew file mode 100644index 0000000000..e69de29bb2diff --git a/Jellyfin.Server/wwwroot/api-docs/swagger/custom.css b/Jellyfin.Server/wwwroot/api-docs/swagger/custom.cssnew file mode 100644index 0000000000..e69de29bb2