Skip to content

Add jsonata-js 2.2 test parity and guardrails - #22

Merged
NirBarak-RecoLabs merged 1 commit into
mainfrom
jsonata-2.2-parity
Aug 23, 2026
Merged

Add jsonata-js 2.2 test parity and guardrails#22
NirBarak-RecoLabs merged 1 commit into
mainfrom
jsonata-2.2-parity

Conversation

@NirBarak-RecoLabs

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed two behavioral gaps found while refreshing against the official jsonata-js v2.2.2 test suite:
    • $contains(str, undefined) now returns undefined instead of raising T0410
    • An empty tuple-group join (e.g. a join filtered to zero matches) now returns {} instead of undefined, matching upstream's "correctly handle empty joins" fix
  • Refreshed testdata/ with the missing v2.2.2 cases: coalescing/default-operator array-predicate cases, $each on an empty object, $toMillis fractional-second truncation, and the two new empty-join cases
  • Added Compile options WithStack, WithTimeout, and WithSequence, matching jsonata-js's stack/timeout/sequence guardrails (errors D1011/D1012/D2015); all are opt-in and existing defaults are unchanged
  • Extended the sequence guardrail to $map, $filter, $each, wildcard (*), and descendant (**) — not just the range operator and $append
  • Compressed the README benchmark tables into a single table per metric category and dropped the RPC-transport column
  • Bumped package version to 0.3.1

Test plan

  • go test ./... passes (all suites, including 7 new testdata/ cases and the new guardrails_test.go)
  • golangci-lint run clean
  • Verified each new guardrail-coverage vector manually ($map, $filter, $each, *, **) before adding regression tests

- Fix $contains(str, undefined) to return undefined instead of
  raising T0410
- Fix empty tuple-group joins to return {} instead of undefined,
  matching upstream's "correctly handle empty joins" behavior
- Refresh testdata from the official jsonata-js v2.2.2 test suite
  (coalescing/default operator array-predicate cases, $each on an
  empty object, $toMillis fractional-second truncation, empty joins)
- Add Compile options WithStack, WithTimeout, and WithSequence,
  matching jsonata-js's stack/timeout/sequence guardrails API
  (errors D1011/D1012/D2015); defaults are unchanged when unused
- Extend the sequence guardrail to $map, $filter, $each, wildcard
  (*), and descendant (**), in addition to the range operator and
  $append
- Compress the README benchmark tables into one table per metric
  category and drop the RPC-transport column
- Bump package version to 0.3.1

Signed-off-by: NirBarak-RecoLabs <nirb@recolabs.ai>
@NirBarak-RecoLabs
NirBarak-RecoLabs merged commit f131d53 into main Aug 23, 2026
2 checks passed
@NirBarak-RecoLabs
NirBarak-RecoLabs deleted the jsonata-2.2-parity branch August 23, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants