[aspnetcore] Fix openapi.json location rename (#56)

Swashbuckle generation was missing the configuration to rename from
default swagger.json to openapi.json (expected by change in SwaggerUI's
configuration for the endpoint).

This generates to the appropriate location and updates the sample to
load the Swagger UI properly on run.
This commit is contained in:
Jim Schubert 2018-05-15 23:16:55 -04:00 committed by William Cheng
parent de5260a7ce
commit 9a8183ab05
2 changed files with 8 additions and 2 deletions

View File

@ -93,7 +93,10 @@ namespace {{packageName}}
.UseMvc()
.UseDefaultFiles()
.UseStaticFiles()
.UseSwagger()
.UseSwagger(c =>
{
c.RouteTemplate = "swagger/{documentName}/openapi.json";
})
.UseSwaggerUI(c =>
{
//TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes)

View File

@ -100,7 +100,10 @@ namespace Org.OpenAPITools
.UseMvc()
.UseDefaultFiles()
.UseStaticFiles()
.UseSwagger()
.UseSwagger(c =>
{
c.RouteTemplate = "swagger/{documentName}/openapi.json";
})
.UseSwaggerUI(c =>
{
//TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes)