diff --git a/src/dashboard/Synapse.Dashboard/Program.cs b/src/dashboard/Synapse.Dashboard/Program.cs index 0714e3bb..5fd9d2fe 100644 --- a/src/dashboard/Synapse.Dashboard/Program.cs +++ b/src/dashboard/Synapse.Dashboard/Program.cs @@ -18,8 +18,19 @@ using ServerlessWorkflow.Sdk.Validation; using System.Text.Json; -var builder = WebAssemblyHostBuilder.CreateDefault(args); +var defaultPropertyNameResolver = ValidatorOptions.Global.PropertyNameResolver; +ValidatorOptions.Global.PropertyNameResolver = (type, member, lambda) => +{ + return member == null ? defaultPropertyNameResolver(type, member, lambda) : member.Name.ToCamelCase(); +}; +var defaultSerializationOptionsConfiguration = Neuroglia.Serialization.Json.JsonSerializer.DefaultOptionsConfiguration; +Neuroglia.Serialization.Json.JsonSerializer.DefaultOptionsConfiguration = (options) => +{ + defaultSerializationOptionsConfiguration(options); + options.WriteIndented = true; +}; +var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); builder.Services.AddLogging(); @@ -53,11 +64,6 @@ /* From AddServerlessWorkflowValidation */ builder.Services.AddScoped(); builder.Services.AddValidatorsFromAssemblyContaining(); -var defaultPropertyNameResolver = ValidatorOptions.Global.PropertyNameResolver; -ValidatorOptions.Global.PropertyNameResolver = (type, member, lambda) => -{ - return member == null ? defaultPropertyNameResolver(type, member, lambda) : member.Name.ToCamelCase(); -}; /* End of AddServerlessWorkflowValidation */ builder.Services.AddSingleton(); builder.Services.AddScoped();