Each parameter in the deserialization constructor on type 'SpeechCreatedEvent' must bind to an object property or field on deserialization. Each parameter name must match with a property or field on the object. The match can be case-insensitive.' #69547
Labels
area-System.Text.Json
question
Answer questions and provide assistance, not an issue with source code or documentation.
Hi I'm migrating from newtonsoft.json to System.Text.Json using .NET6 I have an issues when deserializing json string into object.
The error message is Each parameter in the deserialization constructor on type 'SpeechCreatedEvent' must bind to an object property or field on deserialization. Each parameter name must match with a property or field on the object. The match can be case-insensitive.'
You can find the sample code in the following repository https://github.com/logcorner/DotNetJsonSerilizer
It works fine with newtonsoft.json but raise an exception when using System.Text.Json
With Newtonsoft.Json I have implemented a DefaultContractResolver as following
Do I need to implement a JsonConverter with System.Text.Json ?
Regards
The text was updated successfully, but these errors were encountered: