@@ -, +, @@ --- Koha/REST/Plugin/Query.pm | 2 +- t/Koha/REST/Plugin/Query.t | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) --- a/Koha/REST/Plugin/Query.pm +++ a/Koha/REST/Plugin/Query.pm @@ -364,7 +364,7 @@ sub _parse_embed { $result->{$curr} = { children => _parse_embed( $next ) }; } else { - if ( $curr =~ m/^(?.*)\+count/ ) { + if ( $curr =~ m/^(?.*)[\+|:]count/ ) { my $key = $+{relation} . "_count"; $result->{$key} = { is_count => 1 }; } --- a/t/Koha/REST/Plugin/Query.t +++ a/t/Koha/REST/Plugin/Query.t @@ -433,7 +433,7 @@ subtest '_build_query_params_from_api' => sub { subtest 'stash_embed() tests' => sub { - plan tests => 14; + plan tests => 16; my $t = Test::Mojo->new; @@ -446,6 +446,9 @@ subtest 'stash_embed() tests' => sub { $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'holds+count' } ) ->json_is( '/embed' => { holds_count => { is_count => 1 } } ); + $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'holds:count' } ) + ->json_is( '/embed' => { holds_count => { is_count => 1 } } ); + $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'checkouts,checkouts.item,patron' } ) ->json_is( '/embed' => { checkouts => { children => { item => {} } }, --