Closed omf-jnguyen closed 2 years ago
Hi @omf-jnguyen,
Good afternoon.
Upon investigating further, looks like the Amazon Lex V2 could be having a different request/response format (reference Using an AWS Lambda function). Hence, this is not a bug, instead a new feature request to implement new POCO classes, perhaps better to be part of new project Amazon.Lambda.LexV2Events
. While I cannot commit timeline by which this feature request can be implemented, feel free to contribute in the form of PR. You may take existing Amazon.Lambda.LexEvents project as a starting point and take guidance from Amazon Lex V2 API reference for model classes.
Thanks, Ashish
Thanks for the swift reply @ashishdhingra - really appreciate the insight and guidance. Will follow-up with a PR in the near future then unless you guys beat me to it.
Its related to the version! Lex V1: https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html
And V2: https://docs.aws.amazon.com/lexv2/latest/dg/lambda.html#lambda-input-format
I`m facing the same issue!
@1bberto - yup, realized that so I ended up implementing my own custom models based on v2. Now works like a charm for me!
Here's a gist in case anyone else wants to use them: https://gist.github.com/omf-jnguyen/dbd6cfebeb82780976038e1514a6ecb6
@omf-jnguyen - nice! I think that ifs working like a charm that is totally fine then.
the only thing that you don't need on your code are the attributes JsonPropertyName
on your properties, I think that on the serialization the capitalization is not checked
Amazon.Lambda.LexV2Events 1.0.0 has been released.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Context
Description
LexEvent
does not populate the expected fields, such asCurrentIntent
andSlotDetails
.Reproduction Steps
lexEvent
variable to CloudWatch within the FunctionHandler function:LambdaLogger.Log(JsonSerializer.Serialize(lexEvent));
null
values for fields such asCurrentIntent
andSlotDetails
.Logs
Lex
Invalid Lambda Response: Received error response from Lambda: Unhandled
CloudWatch
Environment
Resolution
This is a :bug: bug-report