Skip to content
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

Deserialize an array into Tuple #129

Closed
Odonno opened this issue Apr 6, 2024 · 2 comments
Closed

Deserialize an array into Tuple #129

Odonno opened this issue Apr 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Odonno
Copy link
Contributor

Odonno commented Apr 6, 2024

Deserializing a CBOR array into a Tuple doesn't seem to work.

Here is a concrete example:

CBOR hexa value: 82664c6f6e646f6e1907e7
CBOR notation: ["London", 2023_1]

The following should deserialize into a Tuple but it currently throws an exception:

var value = Cbor.Deserialize<(string, int)>("82664c6f6e646f6e1907e7".HexaToBinary());

The thrown exception:

Dahomey.Cbor.CborException : [1] Expected major type Map (5)
  Arborescence des appels de procédure :
     at Dahomey.Cbor.Serialization.CborReader.ThrowCbor(String message) in C:\test\Dahomey.Cbor\src\Dahomey.Cbor\Serialization\CborReader.cs:line 1081
   at Dahomey.Cbor.Serialization.Converters.ObjectConverter`1.Read(CborReader& reader) in C:\test\Dahomey.Cbor\src\Dahomey.Cbor\Serialization\Converters\ObjectConverter.cs:line 184
@mcatanzariti
Copy link
Member

reproduced

@mcatanzariti mcatanzariti self-assigned this Apr 6, 2024
@mcatanzariti mcatanzariti added the bug Something isn't working label Apr 6, 2024
@Odonno
Copy link
Contributor Author

Odonno commented Apr 6, 2024

Thank you Michaël

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants