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

feat(p/json): JSON path support #1937

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Conversation

notJoon
Copy link
Member

@notJoon notJoon commented Apr 16, 2024

Description

Implemented a feature that parses JSONPath expression using a state machine and extracts data matching the specified path from the input JSON data.

JSONPath is an expression used to select and filter specific data within a JSON data. This implementation supports the basic functionalities of JSONPath.

Here's a table summarizing the supported JSONPath features now:

Symbol Description Example
Root Object($) Represents the root object of the JSON. All paths start with this symbol $.store.book[0].title
Wildcard(*) Selects all elements of any object or array. $.store.*
Subscript Operator([]) Selects a specific element of an array or object using an index or a key. $.store.book[0]
Deep Scan(..) Selects the specified property regardless of the depth in the JSON. $..price
Slice Operator(:) Selects elements within a range in an array. $.store.book[0:2]

Currently, This implementation focuses on the basic functionality of JSON path expressions to prevent the size of PR is bigger. So, the filter expressions(?(@)) are not implemented yet. but this feature will be added with complex filtering and built-in functions.

I expect, with this JSONPath parser, users can easily extract and utilize desired information from within JSON data.

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Apr 16, 2024
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.15%. Comparing base (93ece90) to head (4741538).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1937      +/-   ##
==========================================
+ Coverage   63.09%   63.15%   +0.05%     
==========================================
  Files         563      563              
  Lines       79273    79515     +242     
==========================================
+ Hits        50015    50215     +200     
- Misses      25893    25933      +40     
- Partials     3365     3367       +2     
Flag Coverage Δ
contribs/gnodev 60.62% <ø> (ø)
contribs/gnofaucet 14.82% <ø> (ø)
gno.land 67.46% <ø> (ø)
gnovm 67.25% <ø> (ø)
misc/genstd 79.72% <ø> (ø)
misc/logos 19.95% <ø> (+0.50%) ⬆️
tm2 62.18% <ø> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@notJoon notJoon changed the title WIP: JSON path feat(p/json): JSON path support Apr 17, 2024
@notJoon notJoon marked this pull request as ready for review June 4, 2024 08:46
@notJoon notJoon requested review from a team as code owners June 4, 2024 08:46
@notJoon notJoon requested review from thehowl and ltzmaxwell and removed request for a team June 4, 2024 08:46
@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Jun 12, 2024
@Kouteki Kouteki added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Oct 8, 2024
@jefft0
Copy link
Contributor

jefft0 commented Oct 21, 2024

Hello @notJoon . Some CI tests from Sept. 3 failed. Maybe merge master again to see if they pass?

@notJoon
Copy link
Member Author

notJoon commented Oct 21, 2024

Hello @notJoon . Some CI tests from Sept. 3 failed. Maybe merge master again to see if they pass?

It causes an unknown panic, so I'll leave it in draft until I resolve it.

@notJoon notJoon marked this pull request as draft October 21, 2024 08:20
@jefft0
Copy link
Contributor

jefft0 commented Oct 21, 2024

Only 3 failed tests this time :-) .

@jefft0
Copy link
Contributor

jefft0 commented Oct 21, 2024

I think the "examples/fmt" failure is easy to fix. "Some gno files are not formatted, please run 'make fmt'."

@jefft0 jefft0 removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Oct 21, 2024
@jefft0
Copy link
Contributor

jefft0 commented Oct 21, 2024

Removed the review/triage-pending label because the author converted this PR to Draft status. When Draft status is removed, we will add the label again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: No status
Status: Backlog
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants