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 => {