From 5fbcc4e6aaab25722d3784e11cb7f74870304e22 Mon Sep 17 00:00:00 2001 From: Nicholas Tsim Date: Mon, 9 Dec 2024 18:00:05 +0000 Subject: [PATCH] EES-5396 Add `api-supported-versions` header to public API --- .../Startup.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Startup.cs b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Startup.cs index f5869882d3..bf86d3e5b5 100644 --- a/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Startup.cs +++ b/src/GovUk.Education.ExploreEducationStatistics.Public.Data.Api/Startup.cs @@ -155,7 +155,16 @@ public void ConfigureServices(IServiceCollection services) }); services.AddProblemDetails(); - services.AddApiVersioning().AddMvc().AddApiExplorer(); + + services + .AddApiVersioning(options => + { + // Supported versions listed in `api-supported-versions` header + options.ReportApiVersions = true; + }) + .AddMvc() + .AddApiExplorer(); + services.AddEndpointsApiExplorer(); // Swagger