From aa87e041bbf5640b9fc9e0cc9d498d22b100bc8b Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Wed, 30 Nov 2016 06:11:22 -0600 Subject: [PATCH] Add Swashbuckle/Swagger (#1) --- ASP.NET Core Basics/src/Contacts/Startup.cs | 5 +++++ ASP.NET Core Basics/src/Contacts/project.json | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ASP.NET Core Basics/src/Contacts/Startup.cs b/ASP.NET Core Basics/src/Contacts/Startup.cs index c64b86e..fee4ec7 100644 --- a/ASP.NET Core Basics/src/Contacts/Startup.cs +++ b/ASP.NET Core Basics/src/Contacts/Startup.cs @@ -55,6 +55,8 @@ public void ConfigureServices(IServiceCollection services) services.AddDbContext(options => options.UseSqlServer(Configuration["Data:ContactsContext:ConnectionString"])); + + services.AddSwaggerGen(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -94,6 +96,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); + + app.UseSwagger(); + app.UseSwaggerUi(); } } } diff --git a/ASP.NET Core Basics/src/Contacts/project.json b/ASP.NET Core Basics/src/Contacts/project.json index 6fa4193..4782f91 100644 --- a/ASP.NET Core Basics/src/Contacts/project.json +++ b/ASP.NET Core Basics/src/Contacts/project.json @@ -1,4 +1,4 @@ -{ +{ "userSecretsId": "aspnet-Contacts-cd2c7b27-e79c-43c7-b3ef-1ecb04374b70", "dependencies": { @@ -43,7 +43,8 @@ "version": "1.1.0-preview4-final", "type": "build" }, - "BundlerMinifier.Core": "2.2.301" + "BundlerMinifier.Core": "2.2.301", + "Swashbuckle": "6.0.0-beta902" }, "tools": {