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

Delete path from JSON #3

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Delete path from JSON #3

merged 1 commit into from
Dec 29, 2023

Conversation

blinktag
Copy link
Member

  • Duplicated gjson::get() into gjson::get_with_key() which returns a tuple now that includes the json key
  • Adding delete_path()

let key_start = match find_key_start(value_begin, key, json.as_bytes()) {
Some(x) => x,
None => {
return Err(GJSONError { msg: "could not find key".to_string() })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the path is not found, the "could not find key" err is bubbled up to the SDK?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will return the error in the wasm response to the SDK

Copy link
Collaborator

@dselans dselans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor question

@blinktag blinktag merged commit 7ed80c5 into main Dec 29, 2023
1 check passed
@blinktag blinktag deleted the blinktag/delete_path branch December 29, 2023 20:16
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.

2 participants