Document the full Data Navigator path syntax - #57
Merged
Merged
Conversation
The Data Navigator page described the supported path expressions as "dot-notation, array indexes, wildcards, filters, recursive descent and the rest of the JSONPath-style expression set", which both undersold the syntax and omitted slices entirely. Replaces that sentence with a Path Syntax reference table covering every form BoxLang's dataNavigate() accepts: dot notation, array indexing, recursive descent, key and array wildcards, inclusive slices and filters. Also adds: - A callout that array indexing is 1-based, following the language convention rather than JSONPath's usual 0-based indexing, since that trips people up - The filter operator set and a note that whitespace inside a filter is tolerated - Guidance that multi-match paths belong with queryPath(), while path() and the toHavePath*() matchers resolve to the first match - Worked filter, recursive-descent and slice examples under queryPath() Slices use their own small example array so the inclusive 1-based window is actually demonstrable, rather than being shown against the page's single-element users array. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0126haQX77C4MLiK3fxwQ59A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Follow-up to #56. The Data Navigator page summarised the supported path expressions in one sentence:
That both undersold the syntax and omitted slices entirely. Anyone wanting the actual grammar had to leave the TestBox book and go read the BoxLang docs.
This replaces that sentence with a proper Path Syntax reference table covering every form
dataNavigate()accepts.app.settings.portusers[1]..namenamekey at any depthapp.settings.*settingsusers[*].namenameof every userprimes[1:3]primes[2:]users[?(@.age > 18)].namenameof every user over 18Also added
users[1]is the first element. This is the detail most likely to bite someone arriving from JSONPath elsewhere.==,!=,>,<,>=,<=), that@refers to the current element, and that whitespace inside a filter is tolerated.queryPath(), whilepath()and thetoHavePath*()matchers resolve to the first match. That mirrorsget()vsquery()on the underlying navigator.queryPath(), which previously only demonstrated wildcards.A note on the slice example
Slices get their own small example array:
The page's shared
datafixture has a single-elementusersarray, so demonstrating a slice against it would have meant asserting how an out-of-range slice behaves — clamped or not — which I did not want to state without confirming. A five-element array makes the inclusive 1-based window self-evident instead.Verification
Path syntax was confirmed against the BoxLang documentation (Data Navigators, DataNavigate BIF) rather than inferred from the TestBox side. JSONPath-style string expressions are available as of BoxLang 1.14.0.
Page checks: code fences balanced, all three
{% hint %}blocks balanced, no tabs (BoxLang-only page, perCLAUDE.md), all fences```java, and the#path-syntaxanchor resolves to a real heading.🤖 Generated with Claude Code
https://claude.ai/code/session_0126haQX77C4MLiK3fxwQ59A
Generated by Claude Code