-
Notifications
You must be signed in to change notification settings - Fork 494
Description
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
- Create Lex v2 bot
- Create intent
- Test
Possible Solution
No response
Additional Information/Context
nluConfidence is class type. In the request json nluConfidence is value type(integer).

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
