moose/MooseX-Storage

Using custom type handler for objects inside array/hash refs

Opened this issue · 3 comments

The docs mention that arrayrefs and hashrefs will be inspected up to one level down to serialize/deserialize any objects that are found, which is great. However, it appears that rather than checking types against the main types list, all blessed objects are passed directly to the generic "object handler". This means that any custom types added with add_custom_type_handler are ignored in this scenario.

Can anyone shed some light on whether this is by-design, a potential area of improvement, or if there's a good workaround?

Specifically, the code in question:
https://metacpan.org/source/ETHER/MooseX-Storage-0.49/lib/MooseX/Storage/Engine.pm#L279
(MooseX::Storage::Engine, Lines 279 - 281)

Ryan, is this a regression in 0.49? The logic with deep objects has
recently been enhanced.

On Mon, Apr 6, 2015 at 3:46 PM, ryan-lang notifications@github.com wrote:

Specifically, the code in question:

https://metacpan.org/source/ETHER/MooseX-Storage-0.49/lib/MooseX/Storage/Engine.pm#L279
(MooseX::Storage::Engine, Lines 279 - 281)


Reply to this email directly or view it on GitHub
#10 (comment).

No, the code in question seems to have existed in at least the last couple versions.

Comparing them now, I see that 0.49 added some new logic nearby, but didn't alter the part that sends all blessed objects to the generic handler (not checked for custom type handlers).