SerializationException:在不期望的位置找到结构或映射的开始:API网关到Step函数 [英] SerializationException:Start of structure or map found where not expected: API Gateway to Step function
问题描述
我正在使用有关从此处将api网关与步骤功能集成的标准博客教程: https://docs.aws.amazon. com/step-functions/latest/dg/tutorial-api-gateway.html
I am using the standard blog tutorial on integrating api gateway with step functions from here: https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-api-gateway.html
我的step函数期望以下输出:
My step function expects the following output:
{
"my_params": {
"config": "config_value"
}
}
博客中提到的执行发布请求所需的请求正文为:
the Request body needed to do a post request as mentioned in the blog is:
{
"input": "{}",
"name": "MyExecution",
"stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:HelloWorld"
}
我正在传递所需的输入,例如:
I am passing my required input like this:
{
"input": {
"my_params": {
"config": "config_value"
}
},
"name": "MyExecution",
"stateMachineArn": "my-arn"
}
但是,我不断出现以下错误:
However, I am continuously getting following error:
{
"__type": "com.amazon.coral.service#SerializationException",
"Message": "Start of structure or map found where not expected."
}
有人可以告诉我这里到底是什么问题吗?我在这里做错了什么?快速帮助表示赞赏.
Can someone tell me what exactly is the problem here? What am I doing wrong here? Quick help appreciated.
推荐答案
按如下所示使用转义符作为参数
Use escape character for your parameters as follows
{
"input": "{
\"my_params\": {
\"config\": \"config_value\"
}
}",
"name": "MyExecution",
"stateMachineArn": "my-arn"
}
这篇关于SerializationException:在不期望的位置找到结构或映射的开始:API网关到Step函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!