Skip to content

fix: allow function names and keywords as JSONPath member names in Arazzo criteria - #304

Merged
TristanSpeakEasy merged 2 commits into
mainfrom
fix/arazzo-jsonpath-member-names
Nov 16, 2026
Merged

TristanSpeakEasy merged 2 commits into
mainfrom
fix/arazzo-jsonpath-member-names

Conversation

@TristanSpeakEasy

@TristanSpeakEasy TristanSpeakEasy commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Why

openapi arazzo validate rejected valid RFC 9535 JSONPath criteria that use a function name or keyword as a member name, such as $.value[0], $.value[?(@.id == 'x')] or $.true. Microsoft Graph and OData list responses put their arrays under value, so this broke a lot of real workflows. Thanks to @kinlane for the report, found via arazzo-conformance.

The bug was in the jsonpath tokenizer and is fixed upstream in speakeasy-api/jsonpath#27 (released as v0.7.1).

Closes #301

What changed

  • Bumped github.com/speakeasy-api/jsonpath to v0.7.1 in the root and cmd/openapi modules. The other workspace modules only had go.sum updates from mise run mod-tidy.
  • Added TestCriterion_Validate_JsonPathKeywordMemberNames_Success, covering the conditions from the issue plus length/keyword member names and a real value() function call.
  • Updated the expected-error ignore string for the Ritza stress test. $.length == 5 is still rejected (a comparison outside a filter isn't valid RFC 9535), but the error now points at the == (column 9) instead of the space after length (column 8).

Review notes

  • One stricter behaviour arrives with v0.7.1: an unknown function such as $[?foo(@.a) > 1] used to be silently treated as length() and is now a parse error. That matches RFC 9535, but it could surface new validation errors on documents that were relying on it.

Testing


Summary by cubic

Fixes openapi arazzo validate rejecting valid RFC 9535 JSONPath criteria that use function names or keywords as member names, such as $.value[0], $.value[?(@.id == 'x')], or $.true. This broke real workflows, since Microsoft Graph and OData list responses put arrays under value. The fix bumps github.com/speakeasy-api/jsonpath to v0.7.1, adds tests covering keyword and function-name member names (value, length, count, match, search), and updates the expected error string for the Ritza stress test. One stricter behavior arrives with the bump: unknown functions like $[?foo(@.a) > 1] were silently treated as length() and are now a parse error, matching RFC 9535, so documents relying on that would now fail validation. Closes #301.

Written for commit 1866a0b. Summary will update on new commits.

View guided diff Turn on auto-fix

@TristanSpeakEasy
TristanSpeakEasy requested a review from a team as a code owner November 16, 2026 00:44
@TristanSpeakEasy TristanSpeakEasy added bug Something isn't working dependencies Dependency updates or changes arazzo Related to Arazzo workflow specifications labels Nov 16, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Shadow auto-approve: would not auto-approve because issues were found.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Bounded dependency bump to jsonpath v0.7.1 fixes Arazzo criteria rejecting valid RFC 9535 keyword/function member names; tests pin the corrected behavior, and the stricter parse of unknown functions matches the spec.

View guided diff | Turn on auto-fix | Re-trigger cubic

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TristanSpeakEasy
TristanSpeakEasy merged commit 6d9ec16 into main Nov 16, 2026
13 checks passed
@TristanSpeakEasy
TristanSpeakEasy deleted the fix/arazzo-jsonpath-member-names branch November 16, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arazzo Related to Arazzo workflow specifications bug Something isn't working dependencies Dependency updates or changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arazzo validate: JSONPath $.value[0] rejected (member named value followed by a bracket)

1 participant