Skip to content

feat(events): improve parameter mapping for triggers#1397

Open
JamesDoingStuff wants to merge 1 commit into
mainfrom
jg/event-parameters-2
Open

feat(events): improve parameter mapping for triggers#1397
JamesDoingStuff wants to merge 1 commit into
mainfrom
jg/event-parameters-2

Conversation

@JamesDoingStuff

Copy link
Copy Markdown
Contributor

AP-1154
The event body field is now treated as the only accessible path for Triggers - as such it is automatically prepended to the path of parameters. Also, allows parameters to have a default value for when path is not resolvable and lets them be assigned by name rather than the order in which they are listed in the trigger

@JamesDoingStuff JamesDoingStuff force-pushed the jg/event-parameters-2 branch from 9c28860 to aafcfb7 Compare June 17, 2026 07:47
messagePath: body.parameters.jpeg
- name: tif
messagePath: body.parameters.tif
jsonPath: parameters.tif

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I realise that is was me that suggested changing the name of this. But I now realise this might be a little confusing.

Even though the docs says JSONPath: https://argoproj.github.io/argo-events/APIs/
it actually follows GJSON syntax https://github.com/tidwall/gjson/blob/master/SYNTAX.md

Apparently GJSON does not exactly implement the current JSONPath standard https://datatracker.ietf.org/doc/html/rfc9535.

So it might be misleading to call this field JSONPath.

Maybe your original was choice was better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah right.. Do you think path would be ok, or is that too vague? Or maybe keyPath? I now feel like messagePath makes it sound like the path to the message rather than a path within the message. And if it's coming from a webhook then I wouldn't really think of it as a message

templateArgs = []

for userParam in userParameters:
param_name: str = userParam.get("name", "")

@davehadley davehadley Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if user sets "name" but not "jsonPath" what happens?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

or vice versa?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's enforced in the CRD that name is always required, plus at least one of jsonPath and default

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