1

I am trying to persist a nested object in sessionAttributes. However, it seems Amazon Lex does not recognize if I send a structure like this in response:

{
    "sessionAttributes": {
        "previousIntent": "TCAIntent",
        "prevSlots": {
            "test": 1
        }
    },
    "dialogAction": {
        "type": "Delegate",
        "slots": {
            "firstName": null,
            "lastName": null,
            "rate": null,
            "rentMortgage": null,
            "downPayment": null,
            "purchasePrice": null,
            "email": null
        }
    }
}

When I replace {"test": 1} with a value, it works fine. Is there a way around this or possible mistake?

Error:

enter image description here

Duy Nguyen
  • 155
  • 1
  • 9

1 Answers1

2

I have figured out that Lex does not allow storing json object or array on sessionAttributes. As a work around, I converted the json object to string and convert it back when I need to use it.

Duy Nguyen
  • 155
  • 1
  • 9