diff options
| author | crobibero <cody@robibe.ro> | 2020-04-19 10:51:51 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-04-19 10:51:51 -0600 |
| commit | 8a7e4cd639be24eb58385dc7b36b466c3d6aed92 (patch) | |
| tree | 89926489750e705e6c68dd4151fe2067250dcbab | |
| parent | 16401ec7ae078b2b7c4c65e3792cb4c4159490d2 (diff) | |
add redoc
| -rw-r--r-- | Jellyfin.Api/Jellyfin.Api.csproj | 3 | ||||
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj index 8f23ef9d0..cbb1d3007 100644 --- a/Jellyfin.Api/Jellyfin.Api.csproj +++ b/Jellyfin.Api/Jellyfin.Api.csproj @@ -10,7 +10,8 @@ <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.3" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" /> - <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" /> + <PackageReference Include="Swashbuckle.AspNetCore" Version="5.3.2" /> + <PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="5.3.2" /> </ItemGroup> <ItemGroup> diff --git a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs index db06eb455..2ab9b0ba5 100644 --- a/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs @@ -14,14 +14,18 @@ namespace Jellyfin.Server.Extensions /// <returns>The updated application builder.</returns> public static IApplicationBuilder UseJellyfinApiSwagger(this IApplicationBuilder applicationBuilder) { - applicationBuilder.UseSwagger(); - // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // specifying the Swagger JSON endpoint. - return applicationBuilder.UseSwaggerUI(c => - { - c.SwaggerEndpoint("/swagger/v1/swagger.json", "Jellyfin API V1"); - }); + const string specEndpoint = "/swagger/v1/swagger.json"; + return applicationBuilder.UseSwagger() + .UseSwaggerUI(c => + { + c.SwaggerEndpoint(specEndpoint, "Jellyfin API V1"); + }) + .UseReDoc(c => + { + c.SpecUrl(specEndpoint); + }); } } } |
