allow for the serializer to get the $xtra data as well

This commit is contained in:
Yanick Champoux 2023-11-12 13:23:01 -05:00
parent c8c273056a
commit 612c87f6b1
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ sub serialize {
my ( $self, $data ) = @_; my ( $self, $data ) = @_;
return $self->json_serializer->serialize( return $self->json_serializer->serialize(
$self->registry->serialize(%$data) ); $self->registry->serialize(@$data) );
} }
sub deserialize { ... } sub deserialize { ... }

View File

@ -6,7 +6,7 @@ use Dancer2::Serializer::JsonApi;
my $serializer = my $serializer =
Dancer2::Serializer::JsonApi->new( log_cb => sub { warn @_ } ); Dancer2::Serializer::JsonApi->new( log_cb => sub { warn @_ } );
my $data = { 'thing' =>, { id => 2 } }; my $data = [ 'thing' => { id => 2 } ];
my $serialized = $serializer->serialize($data); my $serialized = $serializer->serialize($data);