Skip to content

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

@GeekRuthie

Description

@GeekRuthie

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions