-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Writable Json DOM - JsonNumber implementation and tests #39917
Conversation
Basic API for Json writable DOM with scenarios including collection initialization, accessing and modifying Json nodes.
* transformation API added * assertions to existing scenarios added
Basic API for Json writable DOM with scenarios including collection initialization, accessing and modifying Json nodes.
* transformation API added * assertions to existing scenarios added
* IEquatables added * JsonNumber implementation and unit tests added * pragmas deleted * review comments included, more tests added * decimal support added to JsonNumber * decimal support added to JsonArray and JsonObject
Can you make sure to have an issue tracking the API review? |
I created an issue: #39922 and added a PR in my fork with specification: kasiabulat#4. |
We will want that spec checked-in to corefx main fork as well, so do you mind sending another PR to merge that here as well plz? |
src/System.Text.Json/tests/WritableJsonApiTests.JsonNumberUnitTests.cs
Outdated
Show resolved
Hide resolved
src/System.Text.Json/tests/WritableJsonApiTests.JsonNumberUnitTests.cs
Outdated
Show resolved
Hide resolved
src/System.Text.Json/tests/WritableJsonApiTests.JsonNumberUnitTests.cs
Outdated
Show resolved
Hide resolved
src/System.Text.Json/tests/WritableJsonApiTests.JsonNumberUnitTests.cs
Outdated
Show resolved
Hide resolved
src/System.Text.Json/tests/WritableJsonApiTests.JsonNumberUnitTests.cs
Outdated
Show resolved
Hide resolved
src/System.Text.Json/tests/WritableJsonApiTests.JsonNumberUnitTests.cs
Outdated
Show resolved
Hide resolved
🎉 CI works! 🎉 |
Or file an issue to track it, whichever you prefer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix NumberStyles.Float
usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than merge conflict in resx file, good to merge.
Hello @kasiabulat! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
The MacOS test failure is unrelated (in System.Net.Http.Functional.Tests): https://github.com/dotnet/corefx/issues/40115 |
…x#39917) * Json prototype (dotnet/corefx#1) Basic API for Json writable DOM with scenarios including collection initialization, accessing and modifying Json nodes. * Json prototype - transformation API (dotnet/corefx#2) * transformation API added * assertions to existing scenarios added * Json prototype (dotnet/corefx#1) Basic API for Json writable DOM with scenarios including collection initialization, accessing and modifying Json nodes. * Json prototype - transformation API (dotnet/corefx#2) * transformation API added * assertions to existing scenarios added * JsonNumber implementation and tests (dotnet/corefx#3) * IEquatables added * JsonNumber implementation and unit tests added * pragmas deleted * review comments included, more tests added * decimal support added to JsonNumber * decimal support added to JsonArray and JsonObject * all unimplemented classes and methods with accompanying tests removed * First part of documentation added * documentation completed * missing exceptions added * JsonElement changes removed * part of the review comments included * work on review comments * code refactor * more decimal tests added using MemberData * more decimal tests added using MemberData * more test cases added * equals summary adjusted, equals tests added * more Equals tests added, GetHashCode tests added, minor changes * scientifing notation support added, rational numbers tests fixes * rational overflow tests added * ulong maxvalue tests added to rational types * presision problems fixes * exception strings fixed * CI failing fixes (hopefully), review comments included * missing == tests added to achieve 100% branch coverage * review comments included * trailing whitespaces fixes * equals comments added * equals object refactored to call quals json number * merge fix Commit migrated from dotnet/corefx@5050ee8
I am working on adding writable Json DOM under
System.Text.Json
. It will be modifiable, dictionary-backed API to complement the readonlyJsonDocument
, with type hierarchy consisting of the base typeJsonNode
. Currently, I have implementedJsonNumber
which is supposed to represent Json numeric value. Other derived types which we are planning to add include: JsonString, JsonBoolean, JsonArray and JsonObject.More scenarios are available in this class:
https://github.com/kasiabulat/corefx/blob/master/src/System.Text.Json/tests/WritableJsonApiTests.cs
(also in files: WritableJsonApiTests.TestAccessingNestedMembers.cs, WritableJsonApiTests.TestModifying.cs and WritableJsonApiTests.TestTransformations.cs)
cc: @joperezr @bartonjs @ericstj @ahsonkhan @terrajobst @JamesNK