Skip to content

Typeless Serializer: string array is deserialized as object array #176

@TechInterMezzo

Description

@TechInterMezzo

First the code to reproduce the problem:

string[] array = new[] { "test1", "test2" };
byte[] bytes = MessagePackSerializer.Typeless.Serialize(array);
object obj = MessagePackSerializer.Typeless.Deserialize(bytes);

If you debug the code, you see that the result in the obj variable is an object array (object[]) and not a string array. The object array contains the strings, but I need the array itself to be of type string[] or I get an InvalidCastException in other places of my code. There is the same problem if the string array is nested in another object array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions