[Feature Request] Json Serialization:Azure IOT Hub SDK - System.Text.Json #2303
Replies: 4 comments 5 replies
-
The latest preview of the Azure IoT .NET SDK allows you to specify your own serializer that would be used for serialization/deserialization of payloads exchanged with IoT hub - https://github.com/Azure/azure-iot-sdk-csharp/blob/previews/v2/iothub/device/src/Serialization/PayloadConvention.cs You can try out the SDK and let us know your feedback: https://github.com/Azure/azure-iot-sdk-csharp/releases/tag/2022-11-03 Please note that this being a major version revision, there are breaking changes. This migration guide can help you understand those change and guide you on how to port your code over to the v2 SDK. |
Beta Was this translation helpful? Give feedback.
-
I was just working on migrating to the V2 library and encountered a few compilation errors. |
Beta Was this translation helpful? Give feedback.
-
It appears that the "System.Text.Json.JsonSerializer.Serialize" does not work for ClientTwinProperties. The code below produces a JSON string with no key values. |
Beta Was this translation helpful? Give feedback.
-
I'm also interested in switching the IotHub serialization to System.Text.Json but I need to configure the JsonSerializerOptions. I can't see a way to do that in the current client code (using 2.0.0-preview007). Is it possible or do I need to create my own PayloadConvention implementation to do that? |
Beta Was this translation helpful? Give feedback.
-
I would like to know whether 'System.Text.Json' is supported by the latest Azure IoT SDKs? To my understanding, Azure IOT SDK has 'Newtonsoft.json' as a dependency and is the default serializer used for device twins.
The default JsonSerializer for Asp.net core 6.0 is 'System.Text.Json'. It will be great if the same serializer can be used only across all azure SDK dependencies. Please advise.
Beta Was this translation helpful? Give feedback.
All reactions