-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headless deserialization to dynamic object #107
Comments
Hello, |
Hello @alexander-miglis, Sorry for the late answer. I am not sure if I get your question correctly, but the statement you have put is absolutely correct at the moment. As soon as ExpandoObject is supported #112 it will result with a dynamic object. Regards, |
I saw you added this feature and I appreciate that you consider doing it. It would really help me to dynamically read objects from Kafka and re-serialize them as json for example. |
Hello @alexander-miglis The new feature is ready. It's available from v 3.4.0 I've found another way of doing so. It's simply: dynamic deserializedObject = AvroConvert.Deserialize<dynamic>(byte[] avroObject); Please let me know if it solves your case. For Avro to Json conversion, you can simply use AvroConvert.Avro2Json extension. Best, Edit: |
In my use case I get the schema from a schema registry and then read out the message from Kafka headless. So unfortunately this solution does not work for me yet... I would require the headless version of this feature. The idea is that I would be able to use the dynamic object to serialize it to other formats, like json, without having to implement a full object that matches the schema. |
would it be possible to create a feature to dynamically generate an object based on the schema
Something like this
dynamic obj = AvroConvert.DeserializeHeadless<ExpandoObject>(dataBytes, schemaStr);
The text was updated successfully, but these errors were encountered: