diff --git a/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs b/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs
index 1388a2e83..c1caaa892 100644
--- a/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs
+++ b/src/FilterLists.Api/DependencyInjection/Extensions/ConfigureServicesCollection.cs
@@ -1,13 +1,9 @@
-using System;
-using System.IO;
-using Microsoft.ApplicationInsights.Extensibility.Implementation;
+using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.PlatformAbstractions;
using Newtonsoft.Json;
-using Swashbuckle.AspNetCore.Swagger;
namespace FilterLists.Api.DependencyInjection.Extensions
{
@@ -21,7 +17,6 @@ public static void AddFilterListsApi(this IServiceCollection services)
services.AddMvcCustom();
services.AddRoutingCustom();
services.AddApiVersioning();
- services.AddSwaggerGenCustom();
TelemetryDebugWriter.IsTracingDisabled = true;
}
@@ -43,35 +38,5 @@ private static void AddMvcCustom(this IServiceCollection services) =>
private static void AddRoutingCustom(this IServiceCollection services) =>
services.AddRouting(opts => opts.LowercaseUrls = true);
-
- private static void AddSwaggerGenCustom(this IServiceCollection services) =>
- services.AddSwaggerGen(opts =>
- {
- opts.SwaggerDoc("v1",
- new Info
- {
- Title = "FilterLists API",
- Version = "v1",
- Description =
- "An API for FilterLists, the independent, comprehensive directory of all public filter and hosts lists for advertisements, trackers, malware, and annoyances." +
- Environment.NewLine +
- "Home: https://filterlists.com" +
- Environment.NewLine +
- "Data Model Docs: https://github.com/collinbarrett/FilterLists/wiki/Data-Model_sidebar",
- Contact =
- new Contact
- {
- Url = "https://github.com/collinbarrett/FilterLists/",
- Name = "FilterLists - GitHub"
- },
- License = new License
- {
- Name = "MIT License",
- Url = "https://github.com/collinbarrett/FilterLists/blob/master/LICENSE"
- }
- });
- opts.IncludeXmlComments(Path.Combine(PlatformServices.Default.Application.ApplicationBasePath,
- "FilterLists.Api.xml"));
- });
}
}
\ No newline at end of file
diff --git a/src/FilterLists.Api/FilterLists.Api.csproj b/src/FilterLists.Api/FilterLists.Api.csproj
index a9246a9e1..441c93bbb 100644
--- a/src/FilterLists.Api/FilterLists.Api.csproj
+++ b/src/FilterLists.Api/FilterLists.Api.csproj
@@ -35,7 +35,6 @@
-
diff --git a/src/FilterLists.Api/Startup.cs b/src/FilterLists.Api/Startup.cs
index 70fa9e78f..c6971ddcc 100644
--- a/src/FilterLists.Api/Startup.cs
+++ b/src/FilterLists.Api/Startup.cs
@@ -7,7 +7,6 @@
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Swashbuckle.AspNetCore.Swagger;
namespace FilterLists.Api
{
@@ -47,31 +46,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseMvc();
- app.UseSwagger(opts =>
- {
- opts.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.Host = httpReq.Host.Value);
- //TODO: remove preprocessor directives
-#if RELEASE
- opts.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.BasePath = "/api");
-#endif
- opts.RouteTemplate = "docs/{documentName}/swagger.json";
- UseLowercaseControllerNameInSwaggerHack(opts);
- });
- app.UseSwaggerUI(opts =>
- {
- opts.SwaggerEndpoint("v1/swagger.json", "FilterLists API v1");
- opts.DocumentTitle = "FilterLists API v1";
- opts.RoutePrefix = "docs";
- });
}
-
- //TODO: remove hack (https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/74#issuecomment-386762178)
- private static void UseLowercaseControllerNameInSwaggerHack(SwaggerOptions opts) =>
- opts.PreSerializeFilters.Add((document, request) =>
- {
- var paths = document.Paths.ToDictionary(item => item.Key.ToLowerInvariant(), item => item.Value);
- document.Paths.Clear();
- foreach (var pathItem in paths) document.Paths.Add(pathItem.Key, pathItem.Value);
- });
}
}
\ No newline at end of file
diff --git a/src/FilterLists.Api/V1/Controllers/BaseController.cs b/src/FilterLists.Api/V1/Controllers/BaseController.cs
index 2bcceb414..6cce28d1b 100644
--- a/src/FilterLists.Api/V1/Controllers/BaseController.cs
+++ b/src/FilterLists.Api/V1/Controllers/BaseController.cs
@@ -8,7 +8,6 @@
namespace FilterLists.Api.V1.Controllers
{
[ApiVersion("1.0")]
- //TODO: use versioning without needing to manually specify in swagger-ui (https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/370)
[Route("v{version:apiVersion}/[controller]")]
[ResponseCache(Duration = 86400)]
public abstract class BaseController : Controller
diff --git a/src/FilterLists.Web/ClientApp/Layout.tsx b/src/FilterLists.Web/ClientApp/Layout.tsx
index c4516bb69..8024be1a7 100644
--- a/src/FilterLists.Web/ClientApp/Layout.tsx
+++ b/src/FilterLists.Web/ClientApp/Layout.tsx
@@ -45,8 +45,8 @@ const GitHubLink = () =>
;
const ApiLink = () =>
-
+
API
;