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

send_as JSON doesn't seem to be calling serializer hooks #1709

Open
GeekRuthie opened this issue May 9, 2024 · 0 comments
Open

send_as JSON doesn't seem to be calling serializer hooks #1709

GeekRuthie opened this issue May 9, 2024 · 0 comments

Comments

@GeekRuthie
Copy link

I'm working on a new plugin to intercept send_as serialized requests, and (despite the fact that the call to execute_hook is in the Role's "around"), I'm not seeing the before_serializer or after_serializer hooks firing. The code in send_as seems to be calling up Dancer2::Core::Serializer::JSON::serialize here, but hooks just aren't firing! I've tried adding a before_serializer hook in the application, as well as this, in the plugin I'm working with:

$plugin->app->add_hook( Dancer2::Core::Hook->new( name => 'engine.serializer.before', code => sub { warn 'Oh, yeah!' }, ));

I think I'll put in some tracers in D2 code to make sure what apparently should be happening here, actually is. (It's possible I'm Doing It Wrong, too, of course.)

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

1 participant