From cd4c233b60768be56d74f00cf7606cb197da46cc Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Tue, 2 Jun 2026 10:52:58 -0400 Subject: [PATCH] Fix formula export casing: use camelCase to match import property lookups System.Text.Json defaults to PascalCase for anonymous types, producing "Name"/"OutputMode" etc., while the import used TryGetProperty("name") causing every template to fail with "no name". Adding CamelCase naming policy aligns the export format with what the import expects. Co-Authored-By: Claude Sonnet 4.6 --- .../Controllers/CompanySettingsController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PowderCoating.Web/Controllers/CompanySettingsController.cs b/src/PowderCoating.Web/Controllers/CompanySettingsController.cs index d9224cb..bc9ebde 100644 --- a/src/PowderCoating.Web/Controllers/CompanySettingsController.cs +++ b/src/PowderCoating.Web/Controllers/CompanySettingsController.cs @@ -3073,7 +3073,11 @@ public class CompanySettingsController : Controller }; var json = System.Text.Json.JsonSerializer.Serialize(export, - new System.Text.Json.JsonSerializerOptions { WriteIndented = true }); + new System.Text.Json.JsonSerializerOptions + { + WriteIndented = true, + PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase + }); var filename = $"formula-templates-{DateTime.UtcNow:yyyyMMdd}.json"; return File(System.Text.Encoding.UTF8.GetBytes(json), "application/json", filename); }