Skip to content

Commit 8682586

Browse files
author
Timothy Dodd
committed
Refactor JsonOptions in Constants class
Changed JsonOptions from readonly to static and simplified its initialization to only include PropertyNameCaseInsensitive. Removed unnecessary options for clarity and conciseness.
1 parent c00d691 commit 8682586

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/HubitatMqtt/Common/Constants.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,5 @@
33

44
public class Constants
55
{
6-
public static readonly JsonSerializerOptions JsonOptions = new JsonSerializerOptions()
7-
{
8-
PropertyNameCaseInsensitive = true,
9-
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
10-
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
11-
WriteIndented = false // Optimize for size
12-
};
6+
public static JsonSerializerOptions JsonOptions = new JsonSerializerOptions() { PropertyNameCaseInsensitive = true };
137
}

0 commit comments

Comments
 (0)