msgpack / msgpack-perl

MessagePack serializer implementation for Perl / msgpack.org[Perl]
http://msgpack.org/
Other
51 stars 22 forks source link

Use Types::Serialiser::Boolean for true/false #17

Open wisnij opened 10 years ago

wisnij commented 10 years ago

Could Types::Serialiser::Boolean be used rather than defining Data::MessagePack::Boolean internally? Using and checking for that during conversion would make interoperability with other serialization formats a lot easier. In particular, it would be a big win to be able to convert from JSON text to Perl data and then into MessagePack, and vice versa, without having to account for the boolean types manually.

gfx commented 10 years ago

Looks nice. Patches welcome!

FGasper commented 7 years ago

I’m working on a module to support WAMP, a messaging/RPC protocol. That protocol supports MessagePack, but it’s a bit clumsy to implement because D::MP only uses its own boolean objects.

Can you point me in the appropriate direction for accessing and testing equality of a Perl global from XS? I may try to find time to work on this.

foobargeez commented 7 years ago

Ah, I am stuck with this one as well -- JSON->Perl data->MP -- fails.

Looks like a MR has already been submitted to address this -- https://github.com/msgpack/msgpack-perl/pull/37.

Is there anything I can help with to have the fix merged into the module?

Thanks in advance!

foobargeez commented 7 years ago

Something in production broke because of this issue, so I had to come up with a workaround. Sharing it here so it helps others who may be looking for one:

That should do the trick until the Data::MessagePack deals with Types::Serialiser::Boolean blessed objects.

FGasper commented 7 years ago

@foobargeez I’m not sure why my PR is closed, but it expands compatibility to Types::Serialiser while maintaining compatibility with the proprietary flags.

This module appears to be abandoned, though. I tried to contact the maintainer several times and got no response.