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

[#41] Add a line briefly describing descendant operator in docs #53

Merged
merged 4 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions serde_json_path/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# Unreleased

- **documentation**: Add line describing Descendant Operator ([#53])

[#53]: https://github.com/hiltontj/serde_json_path/pull/53

# 0.6.2 (13 July 2023)

* **fixed**: Fixed an issue in the evaluation of `SingularQuery`s that was producing false positive query results when relative singular queries, e.g., `@.bar`, were being used as comparables in a filter, e.g., `$.foo[?(@.bar == 'baz')]` ([#50])
Expand Down
9 changes: 6 additions & 3 deletions serde_json_path/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@
//! # }
//! ```
//!
//! #### Recursive descent (`..`)
//! #### Descendant Operator (`..`)
//!
//! JSONPath query segments following a descendant operator (`..`) will visit the input node and each of its [descendants][ietf-descendants-def].
//!
//! ```rust
//! # use serde_json::json;
Expand All @@ -193,8 +195,9 @@
//! # }
//! ```
//!
//! [jp_spec]: https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-14.html
//! [jp_selectors]: https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-14.html#name-selectors-2
//! [jp_spec]: https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-17.html
//! [jp_selectors]: https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-17.html#name-selectors-2
//! [ietf-descendants-def]: https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-17.html#section-1.1-6.28.1

#![warn(
clippy::all,
Expand Down
2 changes: 1 addition & 1 deletion serde_json_path/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn parse_current_query(input: &str) -> PResult<Query> {
}

#[cfg_attr(feature = "trace", tracing::instrument(level = "trace", parent = None, ret, err))]
pub(self) fn parse_query(input: &str) -> PResult<Query> {
fn parse_query(input: &str) -> PResult<Query> {
alt((parse_root_query, parse_current_query))(input)
}

Expand Down
2 changes: 1 addition & 1 deletion serde_json_path/src/parser/primitive/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ mod tests {
Ok(("", String::from("te\"st")))
);
assert_eq!(
parse_string_literal(r#"'te\'st'"#),
parse_string_literal(r"'te\'st'"),
Ok(("", String::from("te'st")))
);
}
Expand Down