Skip to content

SerializerOptions not passed down in PositionConverter.Read #18

Description

@mlaban

Hi,

Just noticed an issue with PositionConverter. Whenever the coordinates list contains [-Infinity] or any other string literals, the converter throws an exception.
In out code, we do pass SerializationOptions with NumberHandling=JsonNumberHandling.AllowNamedFloatingPointLiterals; but since it's not passed along in PositionConverter.Read(), the deserialization fails when encountering string literals.

Here:

coordinates = JsonSerializer.Deserialize<double[]>(ref reader);

Fix is simple, just pass the converter as a param of JsonSerialzier.Deserialize(double[]))(ref reader, options);

Cheers,
Laura

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions