Skip to content

Commit

Permalink
Adds back config for v2-4 endpoints to swagger (#548)
Browse files Browse the repository at this point in the history
* Add nonces to swagger html so it loads with csp changes

* Add back config for v2-4 endpoints in swagger
  • Loading branch information
cshnimble authored Aug 1, 2024
1 parent 4aca5ae commit f7641d6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions TramsDataApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace TramsDataApi
using Microsoft.AspNetCore.Http;
using System.Text;
using NetEscapades.AspNetCore.SecurityHeaders;
using TramsDataApi.Swagger;

public class Startup
{
Expand Down Expand Up @@ -95,12 +96,6 @@ public void ConfigureServices(IServiceCollection services)
});
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new()
{
Title = "Academies API",
Version = "v1"
});

string descriptions = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
string descriptionsPath = Path.Combine(AppContext.BaseDirectory, descriptions);
if (File.Exists(descriptionsPath)) c.IncludeXmlComments(descriptionsPath);
Expand All @@ -110,6 +105,7 @@ public void ConfigureServices(IServiceCollection services)
c.IncludeXmlComments(xmlPath);
c.EnableAnnotations();
});
services.ConfigureOptions<SwaggerOptions>();
services.AddHttpContextAccessor();

services
Expand Down

0 comments on commit f7641d6

Please sign in to comment.