Remove versioned API

This commit is contained in:
crobibero 2020-04-29 08:04:05 -06:00
parent d491b1b45f
commit 806ae1bc07
4 changed files with 11 additions and 11 deletions

View File

@ -26,7 +26,7 @@ namespace Emby.Server.Implementations.Browser
/// <param name="appHost">The app host.</param>
public static void OpenSwaggerPage(IServerApplicationHost appHost)
{
TryOpenUrl(appHost, "/api-docs/v1/swagger");
TryOpenUrl(appHost, "/api-docs/swagger");
}
/// <summary>

View File

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Configuration;
using Jellyfin.Server.Middleware;
using Microsoft.AspNetCore.Builder;
namespace Jellyfin.Server.Extensions
@ -31,19 +30,20 @@ namespace Jellyfin.Server.Extensions
return applicationBuilder
.UseSwagger(c =>
{
c.RouteTemplate = $"/{baseUrl}api-docs/{{documentName}}/openapi.json";
// Custom path requires {documentName}, SwaggerDoc documentName is 'api-docs'
c.RouteTemplate = $"/{baseUrl}{{documentName}}/openapi.json";
})
.UseSwaggerUI(c =>
{
c.DocumentTitle = "Jellyfin API v1";
c.SwaggerEndpoint($"/{baseUrl}api-docs/v1/openapi.json", "Jellyfin API v1");
c.RoutePrefix = $"{baseUrl}api-docs/v1/swagger";
c.DocumentTitle = "Jellyfin API";
c.SwaggerEndpoint($"/{baseUrl}api-docs/openapi.json", "Jellyfin API");
c.RoutePrefix = $"{baseUrl}api-docs/swagger";
})
.UseReDoc(c =>
{
c.DocumentTitle = "Jellyfin API v1";
c.SpecUrl($"/{baseUrl}api-docs/v1/openapi.json");
c.RoutePrefix = $"{baseUrl}api-docs/v1/redoc";
c.DocumentTitle = "Jellyfin API";
c.SpecUrl($"/{baseUrl}api-docs/openapi.json");
c.RoutePrefix = $"{baseUrl}api-docs/redoc";
});
}
}

View File

@ -96,7 +96,7 @@ namespace Jellyfin.Server.Extensions
{
return serviceCollection.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Jellyfin API", Version = "v1" });
c.SwaggerDoc("api-docs", new OpenApiInfo { Title = "Jellyfin API" });
// Add all xml doc files to swagger generator.
var xmlFiles = Directory.GetFiles(

View File

@ -529,7 +529,7 @@ namespace Jellyfin.Server
var inMemoryDefaultConfig = ConfigurationOptions.DefaultConfiguration;
if (startupConfig != null && !startupConfig.HostWebClient())
{
inMemoryDefaultConfig[HttpListenerHost.DefaultRedirectKey] = "api-docs/v1/swagger";
inMemoryDefaultConfig[HttpListenerHost.DefaultRedirectKey] = "api-docs/swagger";
}
return config