Merge branch 'serialize-array'

This commit is contained in:
Yanick Champoux 2023-11-12 13:23:45 -05:00
commit e89a3ffc97
3 changed files with 25 additions and 2 deletions

View File

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

23
t/merge-ready/perltidy.t Normal file
View File

@ -0,0 +1,23 @@
use 5.32.0;
use Test2::V0;
use Git::Wrapper;
use Test::PerlTidy qw( run_tests );
my $target_branch = $ENV{TARGET_BRANCH} // 'main';
my $git = Git::Wrapper->new('.');
my $on_target = grep { "* $target_branch" eq $_ } $git->branch;
if ($on_target) {
run_tests();
}
else {
my @files =
$git->diff( { name_only => 1, diff_filter => 'ACMR' }, $target_branch );
ok Test::PerlTidy::is_file_tidy($_), $_ for @files;
}
done_testing;

View File

@ -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);