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

Fix Only failes on parsing from floating point to int not long #2668

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

isdaniel
Copy link

@isdaniel isdaniel commented Apr 7, 2022

This MR will let int & long have the same behaviour for throwing an error when deserializing a floating-point value onto an integer property.

As before discussed in #654 Error converting float value to integer in Web API

But now that only worked in int but not in long

I had added some unit tests to make sure long behaviour will be as same as int

I also saw there is another issue #2664, this MR might solve this problem.

…deserializing a floating-point value onto an integer property.

1. implement long throw exception from floating-point to long
2. update global.json 6.0.200
3. add test case for JamesNK#2664
@thomas-oliver-cko
Copy link

Hi @isdaniel, we'd love to see this merged at some point. Is there anything we can do to help?

…floating-point-not-long-#2664

# Conflicts:
#	Src/Newtonsoft.Json.Tests/JsonTextReaderTests/ExceptionHandlingAsyncTests.cs
#	Src/Newtonsoft.Json.Tests/JsonTextReaderTests/ReadAsyncTests.cs
#	Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs
#	Src/global.json
@isdaniel
Copy link
Author

Hi @thomas-oliver-cko

I am glad you like this MR.

I saw there were some conflicts created by the new modification.

Now, I have fixed it.

@isdaniel
Copy link
Author

Hi @JamesNK Could you please take look at this? Thanks.

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

Successfully merging this pull request may close these issues.

None yet

2 participants