gpt4 book ai didi

amazon-web-services - 序列化异常:Start of structure or map found where not expected: API Gateway to Step function

转载 作者:行者123 更新时间:2023-12-01 23:23:08 33 4
gpt4 key购买 nike

我正在使用标准博客教程将 api 网关与此处的步骤函数集成: https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-api-gateway.html

我的步骤函数需要以下输出:

{
"my_params": {
"config": "config_value"
}
}

博客中提到的执行发布请求所需的请求正文是:

{
"input": "{}",
"name": "MyExecution",
"stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:HelloWorld"
}

我正在传递所需的输入,如下所示:

{
"input": {
"my_params": {
"config": "config_value"
}
},
"name": "MyExecution",
"stateMachineArn": "my-arn"
}

但是,我不断收到以下错误:

{
"__type": "com.amazon.coral.service#SerializationException",
"Message": "Start of structure or map found where not expected."
}

有人能告诉我这里到底出了什么问题吗?我在这里做错了什么?感谢快速帮助。

最佳答案

对参数使用转义字符,如下所示

{
"input": "{
\"my_params\": {
\"config\": \"config_value\"
}
}",
"name": "MyExecution",
"stateMachineArn": "my-arn"
}

关于amazon-web-services - 序列化异常:Start of structure or map found where not expected: API Gateway to Step function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48211335/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com