diff --git a/lib/Dancer2/Serializer/JsonApi.pm b/lib/Dancer2/Serializer/JsonApi.pm index cbe4c6d..074b7cd 100644 --- a/lib/Dancer2/Serializer/JsonApi.pm +++ b/lib/Dancer2/Serializer/JsonApi.pm @@ -25,7 +25,7 @@ sub serialize { my ( $self, $data ) = @_; return $self->json_serializer->serialize( - $self->registry->serialize(%$data) ); + $self->registry->serialize(@$data) ); } sub deserialize { ... } diff --git a/t/serializer.t b/t/serializer.t index 46311c7..a568767 100644 --- a/t/serializer.t +++ b/t/serializer.t @@ -6,7 +6,7 @@ use Dancer2::Serializer::JsonApi; my $serializer = Dancer2::Serializer::JsonApi->new( log_cb => sub { warn @_ } ); -my $data = { 'thing' =>, { id => 2 } }; +my $data = [ 'thing' => { id => 2 } ]; my $serialized = $serializer->serialize($data);