Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerializerOptions not passed down in PositionConverter.Read #18

Open
mlaban opened this issue Nov 16, 2022 · 0 comments
Open

SerializerOptions not passed down in PositionConverter.Read #18

mlaban opened this issue Nov 16, 2022 · 0 comments

Comments

@mlaban
Copy link
Contributor

mlaban commented Nov 16, 2022

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

mlaban added a commit to mlaban/GeoJSON.Text that referenced this issue Nov 16, 2022
…et#18

Passing the SerializationOptions along in the internal call to JsonSerializer in PositionConverter.Read(). See issue for details and repro with floating point string literals.
matt-lethargic added a commit that referenced this issue Nov 17, 2022
Fix for PositionConverter.Read SerializerSerializer - Issue #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant