allow for the serializer to get the $xtra data as well
This commit is contained in:
parent
c8c273056a
commit
612c87f6b1
@ -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 { ... }
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user