Skip to content

Commit d885b1e

Browse files
committed
docs: link to functions page from filter syntax description
1 parent ac080d9 commit d885b1e

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**IETF JSONPath Draft compliance**
66

7-
- **Behavioral change.** When applied to a JSON object, filters now have an implicit preceding wildcard selector. This is now consistent with applying filters to arrays and adheres to the IETF JSONPath Internet Draft.
7+
- **Behavioral change.** When applied to a JSON object, filters now have an implicit preceding wildcard selector and the "current" (`@`) object is set to each of the object's values. This is now consistent with applying filters to arrays and adheres to the IETF JSONPath Internet Draft.
88

99
## Version 0.3.0
1010

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ $..products.*.price | $.price_cap
264264
The `&` operator produces matches that are common to both left and right paths. This example would select the list of products that are common to both the "footwear" and "headwear" categories.
265265

266266
```text
267-
$.categories.*[?(@.name == 'footwear')].products.* & $.categories.*[?(@.name == 'headwear')].products.*
267+
$.categories[?(@.name == 'footwear')].products.* & $.categories[?(@.name == 'headwear')].products.*
268268
```
269269

270270
Note that `|` and `&` are not allowed inside filter expressions.
@@ -290,7 +290,6 @@ And this is a list of areas where we deviate from the [IETF JSONPath draft](http
290290
- The root token (default `$`) is optional.
291291
- Paths starting with a dot (`.`) are OK. `.thing` is the same as `$.thing`, as is `thing`, `$[thing]` and `$["thing"]`.
292292
- Nested filters are not supported.
293-
- We don't treat filter expressions without a comparison as existence test, but an "is truthy" test.
294293

295294
And this is a list of features that are uncommon or unique to Python JSONPath.
296295

docs/functions.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Filter Functions
2+
3+
TODO:
4+
5+
## `length()`
6+
7+
TODO:

docs/syntax.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Comparison operators include `==`, `!=`, `<`, `>`, `<=` and `>=`. Plus `<>` as a
134134
$..products[?(@.description =~ /.*trainers/i)]
135135
```
136136

137-
Filters can use [function extensions](#function-extensions) too.
137+
Filters can use [function extensions](functions.md) too.
138138

139139
### Union (`|`) and intersection (`&`)
140140

@@ -149,17 +149,11 @@ $..products.*.price | $.price_cap
149149
The `&` operator produces matches that are common to both left and right paths. This example would select the list of products that are common to both the "footwear" and "headwear" categories.
150150

151151
```text
152-
$.categories.*[?(@.name == 'footwear')].products.* & $.categories.*[?(@.name == 'headwear')].products.*
152+
$.categories[?(@.name == 'footwear')].products.* & $.categories[?(@.name == 'headwear')].products.*
153153
```
154154

155155
Note that `|` and `&` are not allowed inside filter expressions.
156156

157-
## Function extensions
158-
159-
[Filters](#filters-expression) can call functions, be they built-in functions or custom functions. The result of a function call will be evaluated as part of the filter expression.
160-
161-
TODO:
162-
163157
## Notable differences
164158

165159
This is a list of things that you might find in other JSONPath implementation that we don't support (yet).
@@ -177,7 +171,6 @@ And this is a list of areas where we deviate from the [IETF JSONPath draft](http
177171
- The root token (default `$`) is optional.
178172
- Paths starting with a dot (`.`) are OK. `.thing` is the same as `$.thing`, as is `thing`, `$[thing]` and `$["thing"]`.
179173
- Nested filters are not supported.
180-
- We don't treat filter expressions without a comparison as existence test, but an "is truthy" test. See the "Existence of non-singular queries" example in the IETF JSONPath draft.
181174

182175
And this is a list of features that are uncommon or unique to Python JSONPath.
183176

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ nav:
4545
- Advanced Usage: "advanced.md"
4646
- Guides:
4747
- JSONPath Syntax: "syntax.md"
48+
- Filter Functions: "functions.md"
4849
- Async Support: "async.md"
4950
- API Reference:
5051
- High Level API: "api.md"

0 commit comments

Comments
 (0)