在State Machine定义中,为要输出的数字使用一个JSON对象或数组,而不是一个字符串。例如,将输出“42”改为输出“42”作为数字。以下是一个示例:
{
"Comment": "An example of using numbers in AWS Step Functions state output",
"StartAt": "MyState",
"States": {
"MyState": {
"Type": "Pass",
"Result": {
"myNumber": 42
},
"End": true
}
}
}
在此示例中,"myNumber": 42是一个包含一个数字的JSON对象。这将会输出数字42而不是字符串“42”。