awslabs / aws-lambda-dart-runtime

A Dart runtime for AWS Lambda
https://awslabs.github.io/aws-lambda-dart-runtime/
Apache License 2.0
146 stars 30 forks source link

AwsAlexaEvent parsing problem #21

Open shinayser opened 3 years ago

shinayser commented 3 years ago

Check this for the parsing of the AwsAlexaEvent

image

It is expecting and header and a payload object.

The problem is, when we are testing the lambdas on aws, this is the json provided by the lambda testing tool:

{
  "version": "1.0",
  "session": {
    "new": true,
    "sessionId": "amzn1.echo-api.session.123456789012",
    "application": {
      "applicationId": "amzn1.ask.skill.987654321"
    },
    "user": {
      "userId": "amzn1.ask.account.testUser"
    },
    "attributes": {}
  },
  "context": {
    "AudioPlayer": {
      "playerActivity": "IDLE"
    },
    "System": {
      "application": {
        "applicationId": "amzn1.ask.skill.987654321"
      },
      "user": {
        "userId": "amzn1.ask.account.testUser"
      },
      "device": {
        "supportedInterfaces": {
          "AudioPlayer": {}
        }
      }
    }
  },
  "request": {
    "type": "LaunchRequest",
    "requestId": "amzn1.echo-api.request.1234",
    "timestamp": "2016-10-27T18:21:44Z",
    "locale": "en-US"
  }
}

As you can see there is no header or payload objects on this JSON, with ends by returning an empty AwsAlexaEvent.