/// <summary>
/// Writes the pre-encoded property name and raw bytes value (as a base 64 encoded JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="bytes">The binary data to be written as a base 64 encoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="bytes">The Base64-encoded data to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteBase64String(JsonEncodedText propertyName, ReadOnlySpan<byte> bytes)
=> WriteBase64StringHelper(propertyName.EncodedUtf8Bytes, bytes);
/// <summary>
/// Writes the property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="bytes">The binary data to be written as a base 64 encoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="bytes">The Base64-encoded data to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteBase64String(string propertyName, ReadOnlySpan<byte> bytes)
=> WriteBase64String((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan(), bytes);
/// <summary>
/// Writes the property name and raw bytes value (as a base 64 encoded JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="bytes">The binary data to be written as a base 64 encoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="bytes">The Base64-encoded data to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteBase64String(ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> bytes)
{
JsonWriterHelper.ValidatePropertyAndBytes(propertyName, bytes);
/// <summary>
/// Writes the property name and raw bytes value (as a base 64 encoded JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="bytes">The binary data to be written as a base 64 encoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="bytes">The Base64-encoded data to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteBase64String(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<byte> bytes)
{
JsonWriterHelper.ValidatePropertyAndBytes(utf8PropertyName, bytes);
/// <summary>
/// Writes the pre-encoded property name and <see cref="DateTime"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTime"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000.
/// <summary>
/// Writes the property name and <see cref="DateTime"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTime"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000.
/// <summary>
/// Writes the property name and <see cref="DateTime"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTime"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000.
/// <summary>
/// Writes the property name and <see cref="DateTime"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTime"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000.
/// <summary>
/// Writes the pre-encoded property name and <see cref="DateTimeOffset"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTimeOffset"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000-07:00.
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
/// </remarks>
public void WriteString(JsonEncodedText propertyName, DateTimeOffset value)
=> WriteStringHelper(propertyName.EncodedUtf8Bytes, value);
/// <summary>
/// Writes the property name and <see cref="DateTimeOffset"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTimeOffset"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000-07:00.
/// <summary>
/// Writes the property name and <see cref="DateTimeOffset"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTimeOffset"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000-07:00.
/// Writes the property name and <see cref="DateTimeOffset"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="value">The value to to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTimeOffset"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000-07:00.
/// <summary>
/// Writes the pre-encoded property name and <see cref="decimal"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// </remarks>
public void WriteNumber(JsonEncodedText propertyName, decimal value)
=> WriteNumberHelper(propertyName.EncodedUtf8Bytes, value);
/// <summary>
/// Writes the property name and <see cref="decimal"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(string propertyName, decimal value)
/// <summary>
/// Writes the property name and <see cref="decimal"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<char> propertyName, decimal value)
/// <summary>
/// Writes the property name and <see cref="decimal"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<byte> utf8PropertyName, decimal value)
/// <summary>
/// Writes the pre-encoded property name and <see cref="double"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// </remarks>
public void WriteNumber(JsonEncodedText propertyName, double value)
=> WriteNumberHelper(propertyName.EncodedUtf8Bytes, value);
/// <summary>
/// Writes the property name and <see cref="double"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(string propertyName, double value)
/// <summary>
/// Writes the property name and <see cref="double"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<char> propertyName, double value)
/// <summary>
/// Writes the property name and <see cref="double"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<byte> utf8PropertyName, double value)
/// <summary>
/// Writes the pre-encoded property name and <see cref="float"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write..</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// </remarks>
public void WriteNumber(JsonEncodedText propertyName, float value)
=> WriteNumberHelper(propertyName.EncodedUtf8Bytes, value);
/// <summary>
/// Writes the property name and <see cref="float"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write..</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(string propertyName, float value)
/// <summary>
/// Writes the property name and <see cref="float"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write..</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<char> propertyName, float value)
/// <summary>
/// Writes the property name and <see cref="float"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<byte> utf8PropertyName, float value)
/// <summary>
/// Writes the property name and value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="utf8FormattedNumber">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="utf8FormattedNumber">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// Thrown when <paramref name="utf8FormattedNumber"/> does not represent a valid JSON number.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
internal void WriteNumber(ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> utf8FormattedNumber)
/// <summary>
/// Writes the property name and value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="utf8FormattedNumber">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write..</param>
+ /// <param name="utf8FormattedNumber">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// Thrown when <paramref name="utf8FormattedNumber"/> does not represent a valid JSON number.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
internal void WriteNumber(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<byte> utf8FormattedNumber)
/// <summary>
/// Writes the pre-encoded property name and <see cref="Guid"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (i.e. 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
/// </remarks>
public void WriteString(JsonEncodedText propertyName, Guid value)
=> WriteStringHelper(propertyName.EncodedUtf8Bytes, value);
/// <summary>
/// Writes the property name and <see cref="Guid"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (i.e. 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
+ /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
/// The property name is escaped before writing.
/// </remarks>
public void WriteString(string propertyName, Guid value)
/// <summary>
/// Writes the property name and <see cref="Guid"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (i.e. 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
+ /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
/// The property name is escaped before writing.
/// </remarks>
public void WriteString(ReadOnlySpan<char> propertyName, Guid value)
/// <summary>
/// Writes the property name and <see cref="Guid"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (i.e. 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
+ /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
/// The property name is escaped before writing.
/// </remarks>
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, Guid value)
/// <summary>
/// Writes the pre-encoded property name and the JSON literal "null" as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteNull(JsonEncodedText propertyName)
{
/// <summary>
/// Writes the property name and the JSON literal "null" as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteNull(string propertyName)
=> WriteNull((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan());
/// <summary>
/// Writes the property name and the JSON literal "null" as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteNull(ReadOnlySpan<char> propertyName)
{
JsonWriterHelper.ValidateProperty(propertyName);
/// <summary>
/// Writes the property name and the JSON literal "null" as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteNull(ReadOnlySpan<byte> utf8PropertyName)
{
JsonWriterHelper.ValidateProperty(utf8PropertyName);
/// <summary>
/// Writes the pre-encoded property name and <see cref="bool"/> value (as a JSON literal "true" or "false") as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON literal "true" or "false" as part of the name/value pair.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteBoolean(JsonEncodedText propertyName, bool value)
{
/// <summary>
/// Writes the property name and <see cref="bool"/> value (as a JSON literal "true" or "false") as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON literal "true" or "false" as part of the name/value pair.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteBoolean(string propertyName, bool value)
=> WriteBoolean((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan(), value);
/// <summary>
/// Writes the property name and <see cref="bool"/> value (as a JSON literal "true" or "false") as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON literal "true" or "false" as part of the name/value pair.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteBoolean(ReadOnlySpan<char> propertyName, bool value)
{
JsonWriterHelper.ValidateProperty(propertyName);
/// <summary>
/// Writes the property name and <see cref="bool"/> value (as a JSON literal "true" or "false") as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON literal "true" or "false" as part of the name/value pair.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteBoolean(ReadOnlySpan<byte> utf8PropertyName, bool value)
{
JsonWriterHelper.ValidateProperty(utf8PropertyName);
/// <summary>
/// Writes the pre-encoded property name and <see cref="long"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
public void WriteNumber(JsonEncodedText propertyName, long value)
=> WriteNumberHelper(propertyName.EncodedUtf8Bytes, value);
/// <summary>
/// Writes the property name and <see cref="long"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(string propertyName, long value)
/// <summary>
/// Writes the property name and <see cref="long"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<char> propertyName, long value)
/// <summary>
/// Writes the property name and <see cref="long"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<byte> utf8PropertyName, long value)
/// <summary>
/// Writes the pre-encoded property name and <see cref="int"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
public void WriteNumber(JsonEncodedText propertyName, int value)
=> WriteNumber(propertyName, (long)value);
/// <summary>
/// Writes the property name and <see cref="int"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(string propertyName, int value)
/// <summary>
/// Writes the property name and <see cref="int"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
- /// The property name is escaped before writing.
+ /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
public void WriteNumber(ReadOnlySpan<char> propertyName, int value)
=> WriteNumber(propertyName, (long)value);
/// <summary>
/// Writes the property name and <see cref="int"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
public void WriteNumber(ReadOnlySpan<byte> utf8PropertyName, int value)
/// <summary>
/// Writes the pre-encoded property name (as a JSON string) as the first part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WritePropertyName(JsonEncodedText propertyName)
=> WritePropertyNameHelper(propertyName.EncodedUtf8Bytes);
/// <summary>
/// Writes the property name (as a JSON string) as the first part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WritePropertyName(string propertyName)
=> WritePropertyName((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan());
/// <summary>
/// Writes the property name (as a JSON string) as the first part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WritePropertyName(ReadOnlySpan<char> propertyName)
{
JsonWriterHelper.ValidateProperty(propertyName);
/// <summary>
/// Writes the UTF-8 property name (as a JSON string) as the first part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <remarks>
- /// The property name is escaped before writing.
- /// </remarks>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WritePropertyName(ReadOnlySpan<byte> utf8PropertyName)
{
JsonWriterHelper.ValidateProperty(utf8PropertyName);
/// <summary>
/// Writes the pre-encoded property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name and value should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The JSON-encoded value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteString(JsonEncodedText propertyName, JsonEncodedText value)
=> WriteStringHelper(propertyName.EncodedUtf8Bytes, value.EncodedUtf8Bytes);
/// <summary>
/// Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The value should already be escaped when the instance of <see cref="JsonEncodedText"/> was created. The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The JSON-encoded value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteString(string propertyName, JsonEncodedText value)
=> WriteString((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan(), value);
/// <summary>
/// Writes the property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
+ /// <exception cref="ArgumentException">
+ /// Thrown when the specified property name or value is too large.
+ /// </exception>
+ /// <exception cref="ArgumentNullException">
+ /// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
+ /// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
+ /// </exception>
/// <remarks>
/// <para>
/// The property name and value is escaped before writing.
/// as if <see cref="WriteNull(System.ReadOnlySpan{byte})"/> were called.
/// </para>
/// </remarks>
- /// <exception cref="ArgumentException">
- /// Thrown when the specified property name or value is too large.
- /// </exception>
- /// <exception cref="ArgumentNullException">
- /// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
- /// </exception>
- /// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
- /// </exception>
public void WriteString(string propertyName, string value)
{
if (propertyName == null)
/// <summary>
/// Writes the property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name and value is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name or value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name and value is escaped before writing.
+ /// </remarks>
public void WriteString(ReadOnlySpan<char> propertyName, ReadOnlySpan<char> value)
{
JsonWriterHelper.ValidatePropertyAndValue(propertyName, value);
/// <summary>
/// Writes the UTF-8 property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="utf8Value">The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name and value is escaped before writing.
- /// </remarks>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="utf8Value">The UTF-8 encoded value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name or value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name and value is escaped before writing.
+ /// </remarks>
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<byte> utf8Value)
{
JsonWriterHelper.ValidatePropertyAndValue(utf8PropertyName, utf8Value);
/// <summary>
/// Writes the pre-encoded property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
+ /// <exception cref="ArgumentException">
+ /// Thrown when the specified value is too large.
+ /// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
+ /// </exception>
/// <remarks>
/// <para>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
/// The value is escaped before writing.
/// </para>
/// <para>
/// as if <see cref="WriteNull(System.Text.Json.JsonEncodedText)"/> was called.
/// </para>
/// </remarks>
- /// <exception cref="ArgumentException">
- /// Thrown when the specified value is too large.
- /// </exception>
- /// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
- /// </exception>
public void WriteString(JsonEncodedText propertyName, string value)
{
if (value == null)
/// <summary>
/// Writes the pre-encoded property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created. The value is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The value is escaped before writing.
+ /// </remarks>
public void WriteString(JsonEncodedText propertyName, ReadOnlySpan<char> value)
=> WriteStringHelperEscapeValue(propertyName.EncodedUtf8Bytes, value);
/// <summary>
/// Writes the property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name and value is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name or value is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name and value is escaped before writing.
+ /// </remarks>
public void WriteString(string propertyName, ReadOnlySpan<char> value)
=> WriteString((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan(), value);
/// <summary>
/// Writes the UTF-8 property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name and value is escaped before writing.
- /// </remarks>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name or value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name and value is escaped before writing.
+ /// </remarks>
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<char> value)
{
JsonWriterHelper.ValidatePropertyAndValue(utf8PropertyName, value);
/// <summary>
/// Writes the pre-encoded property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="utf8Value">The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created. The value is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="utf8Value">The UTF-8 encoded value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The value is escaped before writing.
+ /// </remarks>
public void WriteString(JsonEncodedText propertyName, ReadOnlySpan<byte> utf8Value)
=> WriteStringHelperEscapeValue(propertyName.EncodedUtf8Bytes, utf8Value);
/// <summary>
/// Writes the property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="utf8Value">The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name and value is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="utf8Value">The UTF-8 encoded value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name or value is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name and value is escaped before writing.
+ /// </remarks>
public void WriteString(string propertyName, ReadOnlySpan<byte> utf8Value)
=> WriteString((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan(), utf8Value);
/// <summary>
/// Writes the property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="utf8Value">The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The property name and value is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="utf8Value">The UTF-8 encoded value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name or value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name and value is escaped before writing.
+ /// </remarks>
public void WriteString(ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> utf8Value)
{
JsonWriterHelper.ValidatePropertyAndValue(propertyName, utf8Value);
/// <summary>
/// Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The value should already be escaped when the instance of <see cref="JsonEncodedText"/> was created. The property name is escaped before writing.
- /// </remarks>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The JSON-encoded value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteString(ReadOnlySpan<char> propertyName, JsonEncodedText value)
=> WriteStringHelperEscapeProperty(propertyName, value.EncodedUtf8Bytes);
/// <summary>
/// Writes the property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
+ /// <exception cref="ArgumentException">
+ /// Thrown when the specified property name or value is too large.
+ /// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
+ /// </exception>
/// <remarks>
/// <para>
/// The property name and value are escaped before writing.
/// as if <see cref="WriteNull(System.ReadOnlySpan{char})"/> was called.
/// </para>
/// </remarks>
- /// <exception cref="ArgumentException">
- /// Thrown when the specified property name or value is too large.
- /// </exception>
- /// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
- /// </exception>
public void WriteString(ReadOnlySpan<char> propertyName, string value)
{
if (value == null)
/// <summary>
/// Writes the UTF-8 property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
- /// <remarks>
- /// The value should already be escaped when the instance of <see cref="JsonEncodedText"/> was created. The property name is escaped before writing.
- /// </remarks>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The JSON-encoded value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The property name is escaped before writing.
+ /// </remarks>
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, JsonEncodedText value)
=> WriteStringHelperEscapeProperty(utf8PropertyName, value.EncodedUtf8Bytes);
/// <summary>
/// Writes the UTF-8 property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
+ /// <exception cref="ArgumentException">
+ /// Thrown when the specified property name or value is too large.
+ /// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
+ /// </exception>
/// <remarks>
/// <para>
/// The property name and value are escaped before writing.
/// as if <see cref="WriteNull(System.ReadOnlySpan{byte})"/> was called.
/// </para>
/// </remarks>
- /// <exception cref="ArgumentException">
- /// Thrown when the specified property name or value is too large.
- /// </exception>
- /// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
- /// </exception>
public void WriteString(ReadOnlySpan<byte> utf8PropertyName, string value)
{
if (value == null)
/// <summary>
/// Writes the pre-encoded property name and <see cref="ulong"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
[CLSCompliant(false)]
public void WriteNumber(JsonEncodedText propertyName, ulong value)
/// <summary>
/// Writes the property name and <see cref="ulong"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
[CLSCompliant(false)]
/// <summary>
/// Writes the property name and <see cref="ulong"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
[CLSCompliant(false)]
/// <summary>
/// Writes the property name and <see cref="ulong"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
[CLSCompliant(false)]
/// <summary>
/// Writes the pre-encoded property name and <see cref="uint"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
+ /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
[CLSCompliant(false)]
public void WriteNumber(JsonEncodedText propertyName, uint value)
/// <summary>
/// Writes the property name and <see cref="uint"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// The <paramref name="propertyName"/> parameter is <see langword="null"/>.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
[CLSCompliant(false)]
/// <summary>
/// Writes the property name and <see cref="uint"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
[CLSCompliant(false)]
/// <summary>
/// Writes the property name and <see cref="uint"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
- /// <param name="utf8PropertyName">The UTF-8 encoded property name of the JSON object to be written.</param>
- /// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
+ /// <param name="utf8PropertyName">The UTF-8 encoded name of the property to write.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified property name is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// The property name is escaped before writing.
/// </remarks>
[CLSCompliant(false)]
/// <summary>
/// Writes the raw bytes value as base 64 encoded JSON string as an element of a JSON array.
/// </summary>
- /// <param name="bytes">The binary data to be written as a base 64 encoded JSON string element of a JSON array.</param>
- /// <remarks>
- /// The bytes are encoded before writing.
- /// </remarks>
+ /// <param name="bytes">The Base64-encoded data to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The bytes are encoded before writing.
+ /// </remarks>
public void WriteBase64StringValue(ReadOnlySpan<byte> bytes)
{
JsonWriterHelper.ValidateBytes(bytes);
/// <summary>
/// Writes the string text value (as a JSON comment).
/// </summary>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON comment within /*..*/.</param>
- /// <remarks>
- /// The comment value is not escaped before writing.
- /// </remarks>
+ /// <param name="value">The value to write as a JSON comment within /*..*/.</param>
/// <exception cref="ArgumentException">
- /// Thrown when the specified value is too large OR if the given string text value contains a comment delimiter (i.e. */).
+ /// Thrown when the specified value is too large OR if the given string text value contains a comment delimiter (that is, */).
/// </exception>
/// <exception cref="ArgumentNullException">
/// The <paramref name="value"/> parameter is <see langword="null"/>.
/// </exception>
+ /// <remarks>
+ /// The comment value is not escaped before writing.
+ /// </remarks>
public void WriteCommentValue(string value)
=> WriteCommentValue((value ?? throw new ArgumentNullException(nameof(value))).AsSpan());
/// <summary>
/// Writes the text value (as a JSON comment).
/// </summary>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON comment within /*..*/.</param>
+ /// <param name="value">The value to write as a JSON comment within /*..*/.</param>
+ /// <exception cref="ArgumentException">
+ /// Thrown when the specified value is too large OR if the given text value contains a comment delimiter (that is, */).
+ /// </exception>
/// <remarks>
/// The comment value is not escaped before writing.
/// </remarks>
- /// <exception cref="ArgumentException">
- /// Thrown when the specified value is too large OR if the given text value contains a comment delimiter (i.e. */).
- /// </exception>
public void WriteCommentValue(ReadOnlySpan<char> value)
{
JsonWriterHelper.ValidateValue(value);
/// The comment value is not escaped before writing.
/// </remarks>
/// <exception cref="ArgumentException">
- /// Thrown when the specified value is too large OR if the given UTF-8 text value contains a comment delimiter (i.e. */).
+ /// Thrown when the specified value is too large OR if the given UTF-8 text value contains a comment delimiter (that is, */).
/// </exception>
public void WriteCommentValue(ReadOnlySpan<byte> utf8Value)
{
/// <summary>
/// Writes the <see cref="DateTime"/> value (as a JSON string) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON string as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTime"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000.
/// <summary>
/// Writes the <see cref="DateTimeOffset"/> value (as a JSON string) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON string as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="DateTimeOffset"/> using the round-trippable ('O') <see cref="StandardFormat"/> , for example: 2017-06-12T05:30:45.7680000-07:00.
/// <summary>
/// Writes the <see cref="decimal"/> value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (i.e. 'G').
+ /// Writes the <see cref="decimal"/> using the default <see cref="StandardFormat"/> (that is, 'G').
/// </remarks>
public void WriteNumberValue(decimal value)
{
/// <summary>
/// Writes the <see cref="double"/> value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="double"/> using the default <see cref="StandardFormat"/> on .NET Core 3 or higher
/// <summary>
/// Writes the <see cref="float"/> value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
/// Writes the <see cref="float"/> using the default <see cref="StandardFormat"/> on .NET Core 3 or higher
/// <summary>
/// Writes the value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="utf8FormattedNumber">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="utf8FormattedNumber">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when <paramref name="utf8FormattedNumber"/> does not represent a valid JSON number.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
internal void WriteNumberValue(ReadOnlySpan<byte> utf8FormattedNumber)
{
/// <summary>
/// Writes the <see cref="Guid"/> value (as a JSON string) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON string as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (i.e. 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
+ /// Writes the <see cref="Guid"/> using the default <see cref="StandardFormat"/> (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
/// </remarks>
public void WriteStringValue(Guid value)
{
/// Writes the JSON literal "null" as an element of a JSON array.
/// </summary>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteNullValue()
{
/// <summary>
/// Writes the <see cref="bool"/> value (as a JSON literal "true" or "false") as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON literal "true" or "false" as an element of a JSON array.</param>
+ /// <param name="value">The value write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteBooleanValue(bool value)
{
/// <summary>
/// Writes the <see cref="int"/> value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="int"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
public void WriteNumberValue(int value)
=> WriteNumberValue((long)value);
/// <summary>
/// Writes the <see cref="long"/> value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="long"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
public void WriteNumberValue(long value)
{
/// <summary>
/// Writes the pre-encoded text value (as a JSON string) as an element of a JSON array.
/// </summary>
- /// <param name="value">The JSON encoded value to be written as a UTF-8 transcoded JSON string element of a JSON array.</param>
- /// <remarks>
- /// The value should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="value">The JSON-encoded value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStringValue(JsonEncodedText value)
=> WriteStringValueHelper(value.EncodedUtf8Bytes);
/// <summary>
/// Writes the string text value (as a JSON string) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
+ /// <exception cref="ArgumentException">
+ /// Thrown when the specified value is too large.
+ /// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
+ /// </exception>
/// <remarks>
- /// <para>The value is escaped before writing.</para>
+ /// <para>
+ /// The value is escaped before writing.</para>
/// <para>
/// If <paramref name="value"/> is <see langword="null"/> the JSON null value is written,
/// as if <see cref="WriteNullValue"/> was called.
/// </para>
/// </remarks>
- /// <exception cref="ArgumentException">
- /// Thrown when the specified value is too large.
- /// </exception>
- /// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
- /// </exception>
public void WriteStringValue(string value)
{
if (value == null)
/// <summary>
/// Writes the text value (as a JSON string) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a UTF-8 transcoded JSON string element of a JSON array.</param>
- /// <remarks>
- /// The value is escaped before writing.
- /// </remarks>
+ /// <param name="value">The value to write.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The value is escaped before writing.
+ /// </remarks>
public void WriteStringValue(ReadOnlySpan<char> value)
{
JsonWriterHelper.ValidateValue(value);
/// Writes the UTF-8 text value (as a JSON string) as an element of a JSON array.
/// </summary>
/// <param name="utf8Value">The UTF-8 encoded value to be written as a JSON string element of a JSON array.</param>
- /// <remarks>
- /// The value is escaped before writing.
- /// </remarks>
/// <exception cref="ArgumentException">
/// Thrown when the specified value is too large.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
+ /// <remarks>
+ /// The value is escaped before writing.
+ /// </remarks>
public void WriteStringValue(ReadOnlySpan<byte> utf8Value)
{
JsonWriterHelper.ValidateValue(utf8Value);
/// <summary>
/// Writes the <see cref="uint"/> value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="uint"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
[CLSCompliant(false)]
public void WriteNumberValue(uint value)
/// <summary>
/// Writes the <see cref="ulong"/> value (as a JSON number) as an element of a JSON array.
/// </summary>
- /// <param name="value">The value to be written as a JSON number as an element of a JSON array.</param>
+ /// <param name="value">The value to write.</param>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
/// <remarks>
- /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (i.e. 'G'), for example: 32767.
+ /// Writes the <see cref="ulong"/> using the default <see cref="StandardFormat"/> (that is, 'G'), for example: 32767.
/// </remarks>
[CLSCompliant(false)]
public void WriteNumberValue(ulong value)
/// </summary>
/// <param name="bufferWriter">An instance of <see cref="IBufferWriter{Byte}" /> used as a destination for writing JSON text into.</param>
/// <param name="options">Defines the customized behavior of the <see cref="Utf8JsonWriter"/>
- /// By default, the <see cref="Utf8JsonWriter"/> writes JSON minimized (i.e. with no extra whitespace)
+ /// By default, the <see cref="Utf8JsonWriter"/> writes JSON minimized (that is, with no extra whitespace)
/// and validates that the JSON being written is structurally valid according to JSON RFC.</param>
/// <exception cref="ArgumentNullException">
/// Thrown when the instance of <see cref="IBufferWriter{Byte}" /> that is passed in is null.
/// </summary>
/// <param name="utf8Json">An instance of <see cref="Stream" /> used as a destination for writing JSON text into.</param>
/// <param name="options">Defines the customized behavior of the <see cref="Utf8JsonWriter"/>
- /// By default, the <see cref="Utf8JsonWriter"/> writes JSON minimized (i.e. with no extra whitespace)
+ /// By default, the <see cref="Utf8JsonWriter"/> writes JSON minimized (that is, with no extra whitespace)
/// and validates that the JSON being written is structurally valid according to JSON RFC.</param>
/// <exception cref="ArgumentNullException">
/// Thrown when the instance of <see cref="Stream" /> that is passed in is null.
/// </summary>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartArray()
{
/// </summary>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartObject()
{
/// <summary>
/// Writes the beginning of a JSON array with a pre-encoded property name as the key.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON array to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartArray(JsonEncodedText propertyName)
{
/// <summary>
/// Writes the beginning of a JSON object with a pre-encoded property name as the key.
/// </summary>
- /// <param name="propertyName">The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
- /// <remarks>
- /// The property name should already be escaped when the instance of <see cref="JsonEncodedText"/> was created.
- /// </remarks>
+ /// <param name="propertyName">The JSON-encoded name of the property to write.</param>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartObject(JsonEncodedText propertyName)
{
/// </exception>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartArray(ReadOnlySpan<byte> utf8PropertyName)
{
/// </exception>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartObject(ReadOnlySpan<byte> utf8PropertyName)
{
/// <summary>
/// Writes the beginning of a JSON array with a property name as the key.
/// </summary>
- /// <param name="propertyName">The property name of the JSON array to be transcoded and written as UTF-8.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <remarks>
/// The property name is escaped before writing.
/// </remarks>
/// </exception>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartArray(string propertyName)
=> WriteStartArray((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan());
/// <summary>
/// Writes the beginning of a JSON object with a property name as the key.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <remarks>
/// The property name is escaped before writing.
/// </remarks>
/// </exception>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartObject(string propertyName)
=> WriteStartObject((propertyName ?? throw new ArgumentNullException(nameof(propertyName))).AsSpan());
/// <summary>
/// Writes the beginning of a JSON array with a property name as the key.
/// </summary>
- /// <param name="propertyName">The property name of the JSON array to be transcoded and written as UTF-8.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <remarks>
/// The property name is escaped before writing.
/// </remarks>
/// </exception>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartArray(ReadOnlySpan<char> propertyName)
{
/// <summary>
/// Writes the beginning of a JSON object with a property name as the key.
/// </summary>
- /// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
+ /// <param name="propertyName">The name of the property to write.</param>
/// <remarks>
/// The property name is escaped before writing.
/// </remarks>
/// </exception>
/// <exception cref="InvalidOperationException">
/// Thrown when the depth of the JSON has exceeded the maximum depth of 1000
- /// OR if this would result in an invalid JSON to be written (while validation is enabled).
+ /// OR if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteStartObject(ReadOnlySpan<char> propertyName)
{
/// Writes the end of a JSON array.
/// </summary>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteEndArray()
{
/// Writes the end of a JSON object.
/// </summary>
/// <exception cref="InvalidOperationException">
- /// Thrown if this would result in an invalid JSON to be written (while validation is enabled).
+ /// Thrown if this would result in invalid JSON being written (while validation is enabled).
/// </exception>
public void WriteEndObject()
{