<PackageReference Include="System.Text.Json" Version="5.0.0" />

JsonReaderOptions

public struct JsonReaderOptions
Provides the ability for the user to define custom behavior when reading JSON.
using System.Runtime.CompilerServices; namespace System.Text.Json { public struct JsonReaderOptions { internal const int DefaultMaxDepth = 64; private int _maxDepth; private JsonCommentHandling _commentHandling; public JsonCommentHandling CommentHandling { [System.Runtime.CompilerServices.IsReadOnly] get { return _commentHandling; } set { if ((int)value > 2) throw ThrowHelper.GetArgumentOutOfRangeException_CommentEnumMustBeInRange("value"); _commentHandling = value; } } public int MaxDepth { [System.Runtime.CompilerServices.IsReadOnly] get { return _maxDepth; } set { if (value < 0) throw ThrowHelper.GetArgumentOutOfRangeException_MaxDepthMustBePositive("value"); _maxDepth = value; } } public bool AllowTrailingCommas { [System.Runtime.CompilerServices.IsReadOnly] get; set; } } }