mirror of
https://github.com/adnanh/webhook.git
synced 2025-06-05 12:12:29 +00:00
Add support for top-level JSON array in payload
Detect if leading character in JSON payload is an array bracket. If found, decode payload into an interface{} and then save the results into payload["root"]. References to payload values would need to reference the leading, "virtual" root node (i.e. "root.0.name"). Fixes #215
This commit is contained in:
parent
f692da2465
commit
0e90ccb441
5 changed files with 127 additions and 5 deletions
|
@ -168,6 +168,22 @@
|
|||
],
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "sendgrid",
|
||||
"execute-command": "{{ .Hookecho }}",
|
||||
"command-working-directory": "/",
|
||||
"response-message": "success",
|
||||
"trigger-rule": {
|
||||
"match": {
|
||||
"type": "value",
|
||||
"parameter": {
|
||||
"source": "payload",
|
||||
"name": "root.0.event"
|
||||
},
|
||||
"value": "processed"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "plex",
|
||||
"execute-command": "{{ .Hookecho }}",
|
||||
|
|
|
@ -97,6 +97,18 @@
|
|||
name: "app.messages.message.#text"
|
||||
value: "Hello!!"
|
||||
|
||||
- id: sendgrid
|
||||
execute-command: '{{ .Hookecho }}'
|
||||
command-working-directory: /
|
||||
response-message: success
|
||||
trigger-rule:
|
||||
match:
|
||||
type: value
|
||||
parameter:
|
||||
source: payload
|
||||
name: root.0.event
|
||||
value: processed
|
||||
|
||||
- id: plex
|
||||
trigger-rule:
|
||||
match:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue