Skip to content

AWS LEX V2 lambda event serialize issue #1248

@antonysamy931

Description

@antonysamy931

Describe the bug

Not able to deserialize event object in lambda handler. It throws following error
tions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
Request object :
{ "sessionId": "042444039656365", "inputTranscript": "hi", "interpretations": [ { "intent": { "slots": {}, "confirmationState": "None", "name": "Welcome_Intent", "state": "InProgress" }, "nluConfidence": 1 }, { "intent": { "slots": {}, "confirmationState": "None", "name": "FallbackIntent", "state": "InProgress" } } ], "responseContentType": "text/plain; charset=utf-8", "invocationSource": "DialogCodeHook", "messageVersion": "1.0", "transcriptions": [ { "resolvedContext": { "intent": "Welcome_Intent" }, "transcription": "hi", "resolvedSlots": {}, "transcriptionConfidence": 1 } ], "sessionState": { "originatingRequestId": "f2837226-8607-4ae5-b62b-db506533871e", "intent": { "slots": {}, "confirmationState": "None", "name": "Welcome_Intent", "state": "InProgress" } }, "inputMode": "Text", "bot": { "aliasName": "TestBotAlias", "aliasId": "TSTALIASID", "name": "DP_botv2_research", "version": "DRAFT", "localeId": "en_US", "id": "HMKPH2BKSM" } }

Expected Behavior

LexV2Event object should be populated based on the request object.

Current Behavior

Throws de-serialization errors.

Reproduction Steps

  1. Create Lex v2 bot
  2. Create intent
  3. Test

Possible Solution

No response

Additional Information/Context

Error place
image

nluConfidence is class type. In the request json nluConfidence is value type(integer).
image

AWS .NET SDK and/or Package version used

Amazon.Lambda.Core : 2.1.0
Amazon.Lambda.LexV2Events : 1.0.0
Amazon.Lambda.Serialization.SystemTextJson : 2.3.0

Targeted .NET Platform

.Net 6

Operating System and version

windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.module/lambda-client-libqueuedservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions