-
Notifications
You must be signed in to change notification settings - Fork 386
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
feat(p/json): Update JSON package with new validators and functions #1869
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
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.
Hey @notJoon! Thanks for improving the package. I left some comments that might not need to be addressed in this PR. Take a look at them if you can and leave your thoughts.
I will play around with the package a bit to test out the performance.
@@ -96,29 +101,33 @@ Encoding (or Marshaling) is the functionality that converts JSON data represente | |||
|
|||
> ⚠️ Caution: Converting a large `Node` type into a JSON string may _impact performance_. or might be cause _unexpected behavior_. |
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.
Typo: or might be cause _unexpected behavior_.
@@ -71,23 +71,28 @@ Decoding (or Unmarshaling) is the functionality that converts an input byte slic | |||
|
|||
The converted `Node` type allows you to modify the JSON data or search and extract data that meets specific conditions. | |||
|
|||
Below is an example of converting a `Node` type into a JSON string, and retrieving all the keys in the JSON data with `json.UniqueKeyLists()`. |
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.
I suggest you break lines in .md files at 80 chars for easier readability in raw mode ;)
@@ -71,23 +71,28 @@ Decoding (or Unmarshaling) is the functionality that converts an input byte slic | |||
|
|||
The converted `Node` type allows you to modify the JSON data or search and extract data that meets specific conditions. | |||
|
|||
Below is an example of converting a `Node` type into a JSON string, and retrieving all the keys in the JSON data with `json.UniqueKeyLists()`. |
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.
I think it's a little bit confusing that you're calling a whole JSON string a Node
, and then you have each subfield as a Node as well. Was there a specific reason to not call the fields inside the JSON string Fields
? Like, FieldString
or StringField
? WDYT?
@@ -71,23 +71,28 @@ Decoding (or Unmarshaling) is the functionality that converts an input byte slic | |||
|
|||
The converted `Node` type allows you to modify the JSON data or search and extract data that meets specific conditions. | |||
|
|||
Below is an example of converting a `Node` type into a JSON string, and retrieving all the keys in the JSON data with `json.UniqueKeyLists()`. |
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.
Do we have any metrics on the package? What about adding a few classic test cases to see the performance (with gno test . -print-runtime-metrics
)? I think this would also turn into a great piece of code for VM stress-testing later down the line.
Hey @notJoon, is this PR still relevant? If so, can you please update it with the latest |
This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months. |
@gfanton, save us 🙏 |
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Description
This pull request updates the JSON package with new validators and functions. It includes the following changes:
New Feature
FIX