I was trying to add Multiple Responses for AWS Lex using AWS Lambda Functions but I am facing this error.
But I am stuck at the message
An error has occurred: Invalid Lambda Response: Received invalid response from Lambda: Can not construct instance of Message, problem: contentType must not be null at [Source: {"dialogAction": {"type": "ConfirmIntent", "message": {"messages": [{"contentType": "PlainText", "group": 1, "content": "Hello"}, {"contentType": "PlainText", "group": 2, "content": "My"}, {"contentType": "PlainText", "group": 3, "content": "Friend"}]}, "intentName": "CardsI", "slots": {"CardsB": null}}}; line: 1, column: 252]
In Lambda Function we are using the following code for printing multiple responses
return {
"dialogAction": {
"type": "ConfirmIntent",
"message": {
"messages": [{
"contentType": "PlainText",
"group": 1,
"content": "Hello"
},
{
"contentType": "PlainText",
"group": 2,
"content": "My"
},
{
"contentType": "PlainText",
"group": 3,
"content": "Friend"
}
]
},
"intentName": "CardsI",
"slots": {
"CardsB": ""
}
}
}
We even went through the documentations such as
https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html#message-groups
https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#special-response
but we still are facing issue. Any help ?