Skip to content

Commit

Permalink
v0.6.1 (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath authored Jul 18, 2023
1 parent 858857e commit bb7301e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.1] - 2023-07-17
### Fixed
- Allow namespace in between selector segments

## [0.6.0] - 2023-05-27
### Changed
- Bump SDK version to 3.0.0
Expand Down Expand Up @@ -152,6 +156,7 @@ Previously, no modification would be made and no errors/exceptions thrown.
### Added
- Basic design draft

[0.6.1]: https://github.com/f3ath/jessie/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/f3ath/jessie/compare/0.5.3...0.6.0
[0.5.3]: https://github.com/f3ath/jessie/compare/0.5.2...0.5.3
[0.5.2]: https://github.com/f3ath/jessie/compare/0.5.1...0.5.2
Expand All @@ -176,4 +181,4 @@ Previously, no modification would be made and no errors/exceptions thrown.
[0.0.0+dev.4]: https://github.com/f3ath/jessie/compare/0.0.0+dev.3...0.0.0+dev.4
[0.0.0+dev.3]: https://github.com/f3ath/jessie/compare/0.0.0+dev.2...0.0.0+dev.3
[0.0.0+dev.2]: https://github.com/f3ath/jessie/compare/0.0.0+dev.1...0.0.0+dev.2
[0.0.0+dev.1]: https://github.com/f3ath/jessie/compare/0.0.0+dev.0...0.0.0+dev.1
[0.0.0+dev.1]: https://github.com/f3ath/jessie/compare/0.0.0+dev.0...0.0.0+dev.1
4 changes: 2 additions & 2 deletions lib/src/grammar/json_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ class JsonPathGrammarDefinition extends GrammarDefinition<Expression<Nodes>> {
dotName,
ref0(_union),
ref0(_recursion),
].toChoiceParser();
].toChoiceParser().trim();

Parser<Selector> _singularSegment() => [
dotName,
ref0(_singularUnion),
].toChoiceParser();
].toChoiceParser().trim();

Parser<Expression<Nodes>> _segmentSequence() =>
_segment().star().map(sequenceSelector).map(Expression.new);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: json_path
version: 0.6.0
version: 0.6.1
description: Implementation of JSONPath expressions like "$.store.book[2].price". Reads and writes values in parsed JSON objects.
homepage: "https://github.com/f3ath/jessie"

Expand Down
2 changes: 1 addition & 1 deletion test/cases/cts
Submodule cts updated 2 files
+80 −12 cts.json
+24 −12 tests/whitespace/selectors.json
21 changes: 21 additions & 0 deletions test/cases/standard/expressions_equality.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,27 @@
"result": [["a", "b"]],
"paths": ["$[0]"],
"pointers": ["/0"]
}, {
"name": "array index with odd spacing",
"selector": "$[?(@ [1] =='b')]",
"document": [["a", "b"], ["x", "y"]],
"result": [["a", "b"]],
"paths": ["$[0]"],
"pointers": ["/0"]
}, {
"name": "object child, single quote",
"selector": "$[?(@['key'] == 'b')]",
"document": [{"key": "a"}, {"key": "b"}, {}],
"result": [{"key": "b"}],
"paths": ["$[1]"],
"pointers": ["/1"]
}, {
"name": "object child, single quote, odd spacing",
"selector": "$[?(@ ['key']=='b')]",
"document": [{"key": "a"}, {"key": "b"}, {}],
"result": [{"key": "b"}],
"paths": ["$[1]"],
"pointers": ["/1"]
}, {
"name": "object child, double quote",
"selector": "$[?(@[\"key\"] == 'b')]",
Expand All @@ -47,6 +61,13 @@
"result": [{"foo": {"bar": "b"}}],
"paths": ["$[1]"],
"pointers": ["/1"]
}, {
"name": "object child, dot-notation, depth 2, odd spacing",
"selector": "$[?(@ \t .foo\n .bar== 'b')]",
"document": [{"foo": {"bar": "a"}}, {"foo": {"bar": "b"}}, {"foo": "b"} ,{}],
"result": [{"foo": {"bar": "b"}}],
"paths": ["$[1]"],
"pointers": ["/1"]
}, {
"name": "object child, dot-notation, int value",
"selector": "$[?(@.id==42)].name",
Expand Down

0 comments on commit bb7301e

Please sign in to comment.