diff --git a/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs b/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs index b8393d228..ebe6158d0 100644 --- a/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs +++ b/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using Microsoft.ApplicationInsights.Extensibility.Implementation; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.PlatformAbstractions; @@ -26,7 +27,9 @@ private static void AddSwaggerGenCustom(this IServiceCollection services) Title = "FilterLists API", Version = "v1", Description = - "A REST-ish API for FilterLists, the independent, comprehensive directory of all public filter and hosts lists for advertisements, trackers, malware, and annoyances.", + "A REST-ish API for FilterLists, the independent, comprehensive directory of all public filter and hosts lists for advertisements, trackers, malware, and annoyances." + + Environment.NewLine + + " - {version} has to be specified manually in Swagger playground below due to https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/370", Contact = new Contact { Url = "https://github.com/collinbarrett/FilterLists/", diff --git a/src/FilterLists.Api/Startup.cs b/src/FilterLists.Api/Startup.cs index e889a0475..3e3bf9628 100644 --- a/src/FilterLists.Api/Startup.cs +++ b/src/FilterLists.Api/Startup.cs @@ -60,6 +60,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) app.UseMvc(); app.UseSwagger(c => { + c.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.BasePath = "/api"); c.RouteTemplate = "docs/{documentName}/swagger.json"; UseLowercaseControllerNameInSwaggerHack(c); });