1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 13:38:13 -05:00

serializer and swagger adjustments for dev

This commit is contained in:
Kyle Spearrin 2019-03-01 17:37:11 -05:00
parent 201f7d9aa4
commit 88cb0443b7

View File

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