feat(events): improve parameter mapping for triggers#1397
feat(events): improve parameter mapping for triggers#1397JamesDoingStuff wants to merge 1 commit into
Conversation
9c28860 to
aafcfb7
Compare
| messagePath: body.parameters.jpeg | ||
| - name: tif | ||
| messagePath: body.parameters.tif | ||
| jsonPath: parameters.tif |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", "") |
There was a problem hiding this comment.
if user sets "name" but not "jsonPath" what happens?
There was a problem hiding this comment.
It's enforced in the CRD that name is always required, plus at least one of jsonPath and default
AP-1154
The event
bodyfield is now treated as the only accessible path for Triggers - as such it is automatically prepended to thepathof parameters. Also, allows parameters to have a default value for whenpathis not resolvable and lets them be assigned by name rather than the order in which they are listed in the trigger