bump System.Text.Json

This commit is contained in:
crobibero
2020-08-25 07:33:58 -06:00
parent 25be1a9b20
commit 5f64ab02a0
14 changed files with 39 additions and 10 deletions

View File

@@ -14,6 +14,11 @@ namespace MediaBrowser.Common.Json.Converters
/// <inheritdoc />
public override int? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
if (reader.TokenType == JsonTokenType.String)
{
ReadOnlySpan<byte> span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan;

View File

@@ -21,6 +21,11 @@ namespace MediaBrowser.Common.Json.Converters
/// <returns>Parsed value.</returns>
public override long? Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
if (reader.TokenType == JsonTokenType.String)
{
// try to parse number directly from bytes

View File

@@ -25,7 +25,7 @@ namespace MediaBrowser.Common.Json
{
ReadCommentHandling = JsonCommentHandling.Disallow,
WriteIndented = false,
IgnoreNullValues = true
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
};
options.Converters.Add(new JsonGuidConverter());