diff --git a/4-minimal-api/1-complete/PizzaStore/Program.cs b/4-minimal-api/1-complete/PizzaStore/Program.cs index 8841f9f..12f08d8 100644 --- a/4-minimal-api/1-complete/PizzaStore/Program.cs +++ b/4-minimal-api/1-complete/PizzaStore/Program.cs @@ -14,14 +14,13 @@ if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); + app.UseSwagger(); + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1"); + }); } -app.UseSwagger(); -app.UseSwaggerUI(c => -{ - c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1"); -}); - app.MapGet("/", () => "Hello World!"); app.MapGet("/pizzas/{id}", (int id) => PizzaDB.GetPizza(id)); diff --git a/4-minimal-api/README.md b/4-minimal-api/README.md index c9c2d5e..a70102c 100644 --- a/4-minimal-api/README.md +++ b/4-minimal-api/README.md @@ -112,14 +112,13 @@ Use Swagger to ensure that you have a self-documenting API, where the docs chang if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); + app.UseSwagger(); + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1"); + }); } - - app.UseSwagger(); - app.UseSwaggerUI(c => - { - c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1"); - }); - + app.MapGet("/", () => "Hello World!"); app.Run();