From f7641d632453df4774b34249472586d6273802fc Mon Sep 17 00:00:00 2001 From: Chris Sherlock <99017916+cshnimble@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:06:24 +0100 Subject: [PATCH] Adds back config for v2-4 endpoints to swagger (#548) * Add nonces to swagger html so it loads with csp changes * Add back config for v2-4 endpoints in swagger --- TramsDataApi/Startup.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/TramsDataApi/Startup.cs b/TramsDataApi/Startup.cs index d3f980c7..01ebc3f2 100644 --- a/TramsDataApi/Startup.cs +++ b/TramsDataApi/Startup.cs @@ -27,6 +27,7 @@ namespace TramsDataApi using Microsoft.AspNetCore.Http; using System.Text; using NetEscapades.AspNetCore.SecurityHeaders; + using TramsDataApi.Swagger; public class Startup { @@ -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); @@ -110,6 +105,7 @@ public void ConfigureServices(IServiceCollection services) c.IncludeXmlComments(xmlPath); c.EnableAnnotations(); }); + services.ConfigureOptions(); services.AddHttpContextAccessor(); services