diff --git a/src/TodoApp/Program.cs b/src/TodoApp/Program.cs index 355b7b72..b9871c4b 100644 --- a/src/TodoApp/Program.cs +++ b/src/TodoApp/Program.cs @@ -17,11 +17,14 @@ builder.Services.AddRazorPages(); // Configure OpenAPI documentation for the Todo API -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddOpenApiDocument(options => +builder.Services.AddOpenApi(options => { - options.Title = "Todo API"; - options.Version = "v1"; + options.UseTransformer((document, _, _) => + { + document.Info.Title = "Todo API"; + document.Info.Version = "v1"; + return Task.CompletedTask; + }); }); if (string.Equals(builder.Configuration["CODESPACES"], "true", StringComparison.OrdinalIgnoreCase)) @@ -57,7 +60,7 @@ app.UseAuthorization(); // Add endpoint for OpenAPI -app.UseOpenApi(); +app.MapOpenApi(); // Add the HTTP endpoints app.MapAuthenticationRoutes(); diff --git a/src/TodoApp/TodoApp.csproj b/src/TodoApp/TodoApp.csproj index 5e30c5d9..5522c635 100644 --- a/src/TodoApp/TodoApp.csproj +++ b/src/TodoApp/TodoApp.csproj @@ -11,9 +11,9 @@ + - diff --git a/src/TodoApp/wwwroot/swagger-ui/index.html b/src/TodoApp/wwwroot/swagger-ui/index.html index f74da4ba..eea5b38b 100644 --- a/src/TodoApp/wwwroot/swagger-ui/index.html +++ b/src/TodoApp/wwwroot/swagger-ui/index.html @@ -32,7 +32,7 @@