|
@@ -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);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|