2 writes to MaxDepth
System.Text.Json (2)
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
1055MaxDepth = EffectiveMaxDepth,
System\Text\Json\Writer\Utf8JsonWriter.cs (1)
259_options.MaxDepth = JsonWriterOptions.DefaultMaxDepth; // If max depth is not set, revert to the default depth.
57 references to MaxDepth
System.Text.Json (57)
System\Text\Json\Writer\Utf8JsonWriter.cs (7)
257if (_options.MaxDepth == 0) 571if (CurrentDepth >= _options.MaxDepth) 665Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1105Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1234=> ThrowHelper.ThrowInvalidOperationException(resource, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); 1239=> ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, maxDepth: _options.MaxDepth, token, _tokenType); 1244=> ThrowHelper.ThrowInvalidOperationException(ExceptionResource.DepthTooLarge, _currentDepth, _options.MaxDepth, token: default, tokenType: default);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (2)
280Debug.Assert(indent <= _indentLength * _options.MaxDepth); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (2)
284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 333Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (2)
283Debug.Assert(indent <= _indentLength * _options.MaxDepth); 332Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (2)
277Debug.Assert(indent <= _indentLength * _options.MaxDepth); 323Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (2)
281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (2)
281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (2)
285Debug.Assert(indent <= _indentLength * _options.MaxDepth); 335Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (8)
17if (propertyName.Length > JsonConstants.MaxCharacterTokenSize || CurrentDepth >= _options.MaxDepth) 18ThrowHelper.ThrowInvalidOperationOrArgumentException(propertyName, _currentDepth, _options.MaxDepth); 24if (utf8PropertyName.Length > JsonConstants.MaxUnescapedTokenSize || CurrentDepth >= _options.MaxDepth) 25ThrowHelper.ThrowInvalidOperationOrArgumentException(utf8PropertyName, _currentDepth, _options.MaxDepth); 31if (CurrentDepth >= _options.MaxDepth) 32ThrowHelper.ThrowInvalidOperationException(_currentDepth, _options.MaxDepth); 106Debug.Assert(indent <= _indentLength * _options.MaxDepth); 178Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (2)
424Debug.Assert(indent <= _indentLength * _options.MaxDepth); 470Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (2)
350Debug.Assert(indent <= _indentLength * _options.MaxDepth); 396Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (6)
187Debug.Assert(indent <= _indentLength * _options.MaxDepth); 375Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1501Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1551Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1602Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1653Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (2)
359Debug.Assert(indent <= _indentLength * _options.MaxDepth); 405Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (1)
91Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (2)
112Debug.Assert(indent <= _indentLength * _options.MaxDepth); 219Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (1)
69Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (1)
66Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (1)
89Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (1)
79Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (2)
146Debug.Assert(indent <= _indentLength * _options.MaxDepth); 293Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (1)
476Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (1)
81Debug.Assert(indent <= _indentLength * _options.MaxDepth);