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
Add JsonElementEquivalencyStep #2576
base: develop
Are you sure you want to change the base?
Conversation
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
According to ChatGPT: Here's a strategy you can use to parse a JSON number without knowing in advance if it's a double or an integer: Parse the JSON string to get a JsonDocument or directly work with a JsonElement if you have one. |
The build failures seem to be something about I could first check |
Rebase to current develop and force push afterwards |
02686ee
to
297351e
Compare
I tried to do the int comparison first, and it didn't look too ugly. ivarne@0902202. Any preferences whether it should be included? |
Pull Request Test Coverage Report for Build 7882714051Details
💛 - Coveralls |
You were a bit ahead of the process. Normally we start with an API proposal before people start to implement a PR. So let's wait until the issue is approved. |
Before participating in discussions on APIs I had to make sure I understood the possibilities and limitations of the library, and when I had something that seemed useful I decided to share. |
Taking some inspiration from #2374, I improved the implementation of
IEquivalencyStep
to actually keep the path when recursing into a json structure and added some tests.I'm a little puzzled about how to compare json numbers. In JS they are 64 bit floating point, so I ended up using
GetDouble()
so that100
and1e2
is equivalent, but used the string for comparingNaN
,Inf
and for generating the error message.As this is part of adding proper support for
System.Text.Json
, I'm not sure how the release notes should be written.IMPORTANT
./build.sh --target spellcheck
or.\build.ps1 --target spellcheck
before pushing and check the good outcome