add redoc
This commit is contained in:
parent
16401ec7ae
commit
8a7e4cd639
|
@ -10,7 +10,8 @@
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.3" />
|
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
<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>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -14,13 +14,17 @@ namespace Jellyfin.Server.Extensions
|
||||||
/// <returns>The updated application builder.</returns>
|
/// <returns>The updated application builder.</returns>
|
||||||
public static IApplicationBuilder UseJellyfinApiSwagger(this IApplicationBuilder applicationBuilder)
|
public static IApplicationBuilder UseJellyfinApiSwagger(this IApplicationBuilder applicationBuilder)
|
||||||
{
|
{
|
||||||
applicationBuilder.UseSwagger();
|
|
||||||
|
|
||||||
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
|
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
|
||||||
// specifying the Swagger JSON endpoint.
|
// specifying the Swagger JSON endpoint.
|
||||||
return applicationBuilder.UseSwaggerUI(c =>
|
const string specEndpoint = "/swagger/v1/swagger.json";
|
||||||
|
return applicationBuilder.UseSwagger()
|
||||||
|
.UseSwaggerUI(c =>
|
||||||
{
|
{
|
||||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Jellyfin API V1");
|
c.SwaggerEndpoint(specEndpoint, "Jellyfin API V1");
|
||||||
|
})
|
||||||
|
.UseReDoc(c =>
|
||||||
|
{
|
||||||
|
c.SpecUrl(specEndpoint);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user