Skip to content

Commit 2fb5fe1

Browse files
Document thread safety for shared JsonSerializerOptions instances
Co-authored-by: mdellison90-stack <230609064+mdellison90-stack@users.noreply.github.com>
1 parent 8db5b63 commit 2fb5fe1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/shared/Core/JsonHelper.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ namespace GitCredentialManager
66
/// <summary>
77
/// Helper class providing common JSON serialization options and utilities.
88
/// </summary>
9+
/// <remarks>
10+
/// The shared JsonSerializerOptions instances should not be modified after initialization
11+
/// to ensure thread safety across the application.
12+
/// </remarks>
913
public static class JsonHelper
1014
{
1115
/// <summary>
1216
/// Gets JSON serializer options configured for case-insensitive property names.
17+
/// Do not modify this instance; create a new instance if different options are needed.
1318
/// </summary>
1419
public static JsonSerializerOptions CaseInsensitiveOptions { get; } = new JsonSerializerOptions
1520
{
@@ -19,6 +24,7 @@ public static class JsonHelper
1924
/// <summary>
2025
/// Gets JSON serializer options configured for case-insensitive property names
2126
/// and ignoring null values when writing.
27+
/// Do not modify this instance; create a new instance if different options are needed.
2228
/// </summary>
2329
public static JsonSerializerOptions CaseInsensitiveIgnoreNullOptions { get; } = new JsonSerializerOptions
2430
{

0 commit comments

Comments
 (0)