Merge pull request #3898 from crobibero/fix-int64

Return int64 in json as number
This commit is contained in:
Bond-009 2020-08-14 20:58:48 +02:00 committed by GitHub
commit af78b9c2e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ using System.Text.Json.Serialization;
namespace MediaBrowser.Common.Json.Converters
{
/// <summary>
/// Long to String JSON converter.
/// Parse JSON string as long.
/// Javascript does not support 64-bit integers.
/// </summary>
public class JsonInt64Converter : JsonConverter<long>
@ -43,14 +43,14 @@ namespace MediaBrowser.Common.Json.Converters
}
/// <summary>
/// Write long to JSON string.
/// Write long to JSON long.
/// </summary>
/// <param name="writer"><see cref="Utf8JsonWriter"/>.</param>
/// <param name="value">Value to write.</param>
/// <param name="options">Options.</param>
public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
{
writer.WriteStringValue(value.ToString(NumberFormatInfo.InvariantInfo));
writer.WriteNumberValue(value);
}
}
}