Skip to content

Commit

Permalink
Revert #8018
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Mar 25, 2024
1 parent 01bd7ba commit 0175f6e
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ internal sealed class FieldsConverter : JsonConverter<Fields>
Fields fields = reader.GetString();
return fields;
}

if (reader.TokenType == JsonTokenType.StartArray)
else if (reader.TokenType == JsonTokenType.StartArray)
{
var fields = new List<Field>();
while (reader.Read() && reader.TokenType != JsonTokenType.EndArray)
Expand All @@ -46,19 +45,6 @@ public override void Write(Utf8JsonWriter writer, Fields value, JsonSerializerOp
return;
}

if (value.ListOfFields.Count == 0)
{
writer.WriteStartObject();
writer.WriteEndObject();
return;
}

if (value.ListOfFields.Count == 1)
{
JsonSerializer.Serialize(writer, value.ListOfFields[0], options);
return;
}

writer.WriteStartArray();
foreach (var field in value.ListOfFields)
{
Expand Down

0 comments on commit 0175f6e

Please sign in to comment.