refactor: webhook.md

This commit is contained in:
daihw 2021-12-31 17:18:47 +08:00
parent 2a99d5b591
commit 5c4a1e752e
1 changed files with 18 additions and 0 deletions

View File

@ -129,3 +129,21 @@ trigger:
表达式`$.body.json.user[0].age`的结果是`3`
*更高阶的用法和具体语法规范可以参考[这里](https://goessner.net/articles/JsonPath/)*
**补充**
为方便用户提取触发器参数在非数组对象中也可以使用JsonPath的过滤表达式
```
trigger:
type: webhook
param:
- name: token1
type: STRING
exp: $.body.json[?(@.token =~ /^ywi6.*$/)].token
- name: token2
type: STRING
exp: $.body.json[?(@.token =~ /^ywi6.*$/i)].token
```
表达式`$.body.json[?(@.token =~ /^ywi6.*$/)].token`的结果是`空`
表达式`$.body.json[?(@.token =~ /^ywi6.*$/i)].token`的结果是`yWi6XOJQ2VQ9BKSUnlK9jTiHY`