Skip to content

Conversation

@frankkilcommins
Copy link
Collaborator

fixes: #366

Spec changes:

Expression Type Object

This replaces the previously named Criterion Expression Type Object and will be reused for both:

  • Criterion Object
  • Selector Object

Allowed type/version values remain:

Type Allowed Versions Default
jsonpath rfc9535, draft-goessner-dispatch-jsonpath-00 rfc9535
xpath xpath-31, xpath-30, xpath-20, xpath-10 xpath-31
jsonpointer rfc6901 Just adding for completeness rfc6901

Selector Object

Introduce a Selector Object, that can be used wherever more complex expressions than what's covered by the Arazzo ABNF grammer against structured data are required.

expression: string   # A valid Arazzo expression (e.g., $response.body)
selector: string     # A selector expression (e.g., $.items[0].id, /Envelope/Item)
type: string | Expression Type Object

Examples of usage:

outputs:
  userEmail:
    expression: $response.body
    selector: $.user.profile.email
    type: jsonpath

RequestBody example:

requestBody:
  contentType: application/json
  payload:
    invoiceId:
      expression: $steps.fetchXml.outputs.invoiceXml
      selector: /Invoice/Header/InvoiceNumber
      type:
        type: xpath
        version: 3.1

Places supporting {expression} for value setting have been extended to support the Selector Object.

Schema Updates

JSON Schema updated in line with spec changes

@frankkilcommins frankkilcommins changed the title feat(spec): Add support for JSONPath and XPath support where JSONPointer is supported feat(spec): Add support for JSONPath and XPath where JSONPointer is supported Nov 27, 2025
Copy link
Collaborator

@kevinduffey kevinduffey left a comment

Choose a reason for hiding this comment

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

LGTM.. I left one comment regarding regex.. there are 2 places that would apply I left it in just the one. If what is there is fine I'm good with that. Wasn't sure so thought I'd leave a "verify this is ok" comment. As such I'll 'request change' but feel free to ignore if its ok and then accept this as Approve.

"name": "userId",
"in": "query",
"value": {
"expression": "$inputs.user",
Copy link
Contributor

@DmitryAnansky DmitryAnansky Nov 28, 2025

Choose a reason for hiding this comment

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

This might be a bit confusing for users. There will be two different ways to describe similar things.

There is already the context, but this PR also suggests expression. Maybe I misunderstood, but it seems to perform a similar role and set the context for the condition.
And selector is similar to condition, maybe without expressions.

              "context": "$response.body",
              "condition": "/Envelope/Status[text()='OK']",
              "type": {
                "type": "xpath",
                "version": "xpath-31"
              }

Were you considering reusing already described Criterion Object as Selector Object?

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.

3 participants