You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
997 B
28 lines
997 B
5 years ago
|
using Microsoft.AspNetCore.Builder;
|
||
|
|
||
5 years ago
|
namespace Jellyfin.Server.Extensions
|
||
5 years ago
|
{
|
||
5 years ago
|
/// <summary>
|
||
|
/// Extensions for adding API specific functionality to the application pipeline.
|
||
|
/// </summary>
|
||
5 years ago
|
public static class ApiApplicationBuilderExtensions
|
||
|
{
|
||
5 years ago
|
/// <summary>
|
||
|
/// Adds swagger and swagger UI to the application pipeline.
|
||
|
/// </summary>
|
||
|
/// <param name="applicationBuilder">The application builder.</param>
|
||
|
/// <returns>The updated application builder.</returns>
|
||
5 years ago
|
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");
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|