This repository has been archived by the owner on Oct 18, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rough draft #1
base: main
Are you sure you want to change the base?
Rough draft #1
Changes from 1 commit
8c2f61e
92e9a9b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much better, but we are no nearer understanding selectors from this. Can we assert that a selected sequence is a subsequence (not necessarily contiguous) of the original?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but each value in the selected sequence is a descendant (or equal to) of a value in the original sequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything to say about common keys? The overuse of the term 'mapping' is potentially confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to define a partial
∪
operation as that's all we need in the remainder of the spec (I think). If we had to handle common keys, we'd need something like Z's function override. How about the following?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of thing is
$
? Is it a selector, a JsonPath or something else? What does it mean for a JSONPath to have a "leading$
", and why does it matter?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are at least two schools of thought. I have tended to think of
$
as a special selector which takes the input value and produces a sequence consisting of just that value. Others think of$
as a kind of delimiter which says "start at the root of the input value". The latter is more consistent with the use of$
in filter notation (which we'll come to later).The original JSONPath article required all JSONPaths to start with
$
, but some implementations make this optional, just to confuse matters.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a
here is a value, I take it. Or an object. Hmm, I'm getting really confused here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a
is probably the worst name for this case. It's any value which isn't an array. It could be an object or a scalar.