From 88cb0443b75a70c9df95e6658ff70255d3ed0f96 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 1 Mar 2019 17:37:11 -0500 Subject: [PATCH] serializer and swagger adjustments for dev --- src/Api/Startup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Api/Startup.cs b/src/Api/Startup.cs index 70a6651e47..83d5772b95 100644 --- a/src/Api/Startup.cs +++ b/src/Api/Startup.cs @@ -114,7 +114,7 @@ namespace Bit.Api config.Conventions.Add(new PublicApiControllersModelConvention()); }).AddJsonOptions(options => { - if(Configuration["swaggerGen"] != "true") + if(Environment.IsProduction() && Configuration["swaggerGen"] != "true") { options.SerializerSettings.ContractResolver = new DefaultContractResolver(); } @@ -191,7 +191,7 @@ namespace Bit.Api // Add MVC to the request pipeline. app.UseMvc(); - if(globalSettings.SelfHosted) + if(Environment.IsDevelopment() || globalSettings.SelfHosted) { app.UseSwagger(config => {