From 1d9285c59443692008514aea0a3a30ff11b468de Mon Sep 17 00:00:00 2001 From: crobibero Date: Tue, 18 Aug 2020 15:52:42 -0600 Subject: [PATCH] add support for custom doc css --- .../Extensions/ApiApplicationBuilderExtensions.cs | 2 ++ Jellyfin.Server/Jellyfin.Server.csproj | 9 +++++++++ Jellyfin.Server/Startup.cs | 1 + Jellyfin.Server/wwwroot/api-docs/redoc/custom.css | 0 Jellyfin.Server/wwwroot/api-docs/swagger/custom.css | 0 5 files changed, 12 insertions(+) create mode 100644 Jellyfin.Server/wwwroot/api-docs/redoc/custom.css create mode 100644 Jellyfin.Server/wwwroot/api-docs/swagger/custom.css diff --git a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs index 745567703..c9539681b 100644 --- a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs @@ -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"); }); } } diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index 7541707d9..88e4d41fb 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -63,4 +63,13 @@ + + + PreserveNewest + + + PreserveNewest + + + diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 108d8f881..c0ddd9af3 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -73,6 +73,7 @@ namespace Jellyfin.Server // TODO app.UseMiddleware(); + 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.css new file mode 100644 index 000000000..e69de29bb diff --git a/Jellyfin.Server/wwwroot/api-docs/swagger/custom.css b/Jellyfin.Server/wwwroot/api-docs/swagger/custom.css new file mode 100644 index 000000000..e69de29bb