TODO swagger hacks

ref #131
This commit is contained in:
Collin Barrett 2018-06-07 16:46:35 -05:00
parent 4add4939dc
commit 76b084499a
2 changed files with 3 additions and 2 deletions

View file

@ -61,6 +61,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseSwagger(c =>
{
c.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.Host = httpReq.Host.Value);
//TODO: remove preprocessor directives
#if RELEASE
c.PreSerializeFilters.Add((swaggerDoc, httpReq) => swaggerDoc.BasePath = "/api");
#endif
@ -76,7 +77,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
MigrateAndSeedDatabase(app);
}
//https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/74#issuecomment-386762178
//TODO: remove hack (https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/74#issuecomment-386762178)
private static void UseLowercaseControllerNameInSwaggerHack(SwaggerOptions c)
{
c.PreSerializeFilters.Add((document, request) =>

View file

@ -4,7 +4,7 @@
namespace FilterLists.Api.V1.Controllers
{
[ApiVersion("1.0")]
//https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/370
//TODO: use versioning without needing to manually specify in swagger-ui (https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/370)
[Route("v{version:apiVersion}/[controller]")]
public class BaseController : Controller
{