Closed mchernoff closed 3 weeks ago
Looking into this! thanks for the bug report @mchernoff
hi @mchernoff
There is a PR open to address this. I think this is good compromise to addressing the issue. Please take a look: https://github.com/deepgram/deepgram-dotnet-sdk/pull/331
this should be available shortly: https://github.com/deepgram/deepgram-dotnet-sdk/releases/tag/4.3.3
Thank you for looking into this and resolving so quickly!
What is the current behavior?
When deserializing the response body in the Deepgram PreRecorded callback, (Deepgram.Models.Listen.v1.REST.SyncResponse), the following exception is thrown:
This seems to be due to the
WarningType
class usingSystem.Runtime.Serialization.EnumMember
attributes to specify key name, which is not supported inSystem.Text.Json
.Newtonsoft.Json
is able to handle this enum, but that package is not compatible with the rest of the data contract, since it usesSystem.Text.Serialization
annotations. For example, theWord.HeardWord
property is not deserialized by Newtonsoft since its JSON property name is "word".Steps to reproduce
Shortened JSON body for example:
Expected behavior
Correctly deserializes into a
SyncResponse
class usingSystem.Text.Json
.Please tell us about your environment
.NET 6 Deepgram SDK v4.3.2