diff --git a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.Tests/IntroductionToWolverineLibrary.Tests.csproj b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.Tests/IntroductionToWolverineLibrary.Tests.csproj index 311a02920..5e236b42c 100644 --- a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.Tests/IntroductionToWolverineLibrary.Tests.csproj +++ b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.Tests/IntroductionToWolverineLibrary.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 enable enable diff --git a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.csproj b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.csproj index 040d6ebfb..e6736550c 100644 --- a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.csproj +++ b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary.csproj @@ -1,15 +1,15 @@  - net8.0 + net10.0 enable enable - - - + + + diff --git a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Program.cs b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Program.cs index 52b9c6e69..1e2df0d20 100644 --- a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Program.cs +++ b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Program.cs @@ -3,8 +3,7 @@ var builder = WebApplication.CreateBuilder(args); -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); +builder.Services.AddOpenApi(); builder.Services.AddControllers(); builder.Host.UseWolverine( x => { @@ -15,20 +14,17 @@ if (app.Environment.IsDevelopment()) { - app.UseSwagger(); - app.UseSwaggerUI(); + app.MapOpenApi(); } app.UseHttpsRedirection(); app.MapPost("/order", async (Order newOrder, IMessageBus bus) => await bus.InvokeAsync(newOrder)) - .WithName("NewBookOrder") - .WithOpenApi(); + .WithName("NewBookOrder"); -app.MapPost("/orderReply", async (Order newOrder, IMessageBus bus) => +app.MapPost("/orderReply", async (Order newOrder, IMessageBus bus) => await bus.InvokeAsync(newOrder)) - .WithName("NewBookOrderReply") - .WithOpenApi(); + .WithName("NewBookOrderReply"); app.MapPost("/bookReview", async (BookReview review, IMessageBus bus) => { @@ -36,10 +32,9 @@ await bus.InvokeAsync(newOrder)) return Results.Ok("Book review submitted successfully."); }) -.WithName("BookReviewEndpoint") -.WithOpenApi(); +.WithName("BookReviewEndpoint"); app.MapControllers(); -app.Run(); \ No newline at end of file +app.Run(); diff --git a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Properties/launchSettings.json b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Properties/launchSettings.json index 2685f52d0..6d093169f 100644 --- a/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Properties/launchSettings.json +++ b/dotnet-client-libraries/IntroductionToWolverineLibrary/IntroductionToWolverineLibrary/Properties/launchSettings.json @@ -13,7 +13,7 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "openapi/v1.json", "applicationUrl": "http://localhost:5137", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" @@ -23,7 +23,7 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "openapi/v1.json", "applicationUrl": "https://localhost:7125;http://localhost:5137", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" @@ -32,7 +32,7 @@ "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "openapi/v1.json", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }