Skip to content

Commit 9d7f270

Browse files
author
Сергей Трегуб
committed
Add indentation to the output jsons in the DEBUG mode
1 parent b5be91b commit 9d7f270

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ProjectTemplates/ReferenceProject/Startup.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ public void ConfigureServices(IServiceCollection services)
8282
options.JsonSerializerOptions.IgnoreNullValues = true;
8383
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));
8484
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
85+
#if DEBUG
86+
options.JsonSerializerOptions.WriteIndented = true;
87+
#else
88+
options.JsonSerializerOptions.WriteIndented = false;
89+
#endif
8590
})
8691
.AddApiExplorer()
8792
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);

0 commit comments

Comments
 (0)