在步骤函数中使用数组索引读取

时间:2019-05-31 19:56:01

标签: aws-step-functions

执行步骤功能时出现以下错误:-

{
  "error": "States.Runtime",
  "cause": "An error occurred while executing the state 'RenameThing' (entered at the event id #9). Invalid path '$.list[$.index]' : com.jayway.jsonpath.InvalidPathException: Could not analyze path component: [$.index]"
}

以下是输入:-

{
  "name": "RenameThing",
  "input": {
    "list": [
      {
        "xxx": "xxxxx",
        "yyy": "yyyyy",
        "zzz": "zzzz"
      },
      {
        "xxx": "xxxxx2",
        "yyy": "yyyyy2",
        "zzz": "zzzz2"
      }
    ],
    "continue": true,
    "index": 0
  }
}

输入路径为:-

"InputPath":"$.list[$.index]",

看来,aws无法找到路径[$ .index]。

0 个答案:

没有答案