MessagePack: how to serialize without types information?

93 Views Asked by At

I try to serialize an object which contains a lists of another objects. I would like to send serialized data to front-end part of my application using SignalR. For serialization I use MessagePack library as a nuget package. My application is written in NET 8 (backend) and frontend uses ReactJS.

I have tried serialize some data this way:

var serializedData = MessagePackSerializer.Typeless.Serialize(graphic);

But when I send this data over SignalR and in my browser I could see names of classes inside binary data like on the image below: (https://i.stack.imgur.com/qnmEM.png)

In this image you could see names like: "FileType", "VectorStyle" etc.. Info about types also leads to an increased file size, because before serialization file size is 4MB and after in my browser I see that sent data is over 5MB

What I want to achieve is to serialize data without any type names. I would be greatful for any advice or help :)

0

There are 0 best solutions below