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

Using custom type handler for objects inside array/hash refs #10

Open
ryan-lang opened this issue Apr 6, 2015 · 3 comments
Open

Using custom type handler for objects inside array/hash refs #10

ryan-lang opened this issue Apr 6, 2015 · 3 comments

Comments

@ryan-lang
Copy link

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?

@ryan-lang
Copy link
Author

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)

@karenetheridge
Copy link
Member

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 [email protected] 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).

@ryan-lang
Copy link
Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants