my @arg_protos = @{$self->attributes->{Args}||[]};
return [] unless scalar(@arg_protos);
+ return [] unless defined($arg_protos[0]);
+
# If there is only one arg and it looks like a number
# we assume its 'classic' and the number is the number of
# constraints.
my @arg_protos = @{$self->attributes->{CaptureArgs}||[]};
return [] unless scalar(@arg_protos);
+ return [] unless defined($arg_protos[0]);
# If there is only one arg and it looks like a number
# we assume its 'classic' and the number is the number of
# constraints.
@{ $self->_endpoints }
) {
my $args = $endpoint->list_extra_info->{Args};
- my @parts = (defined($args) ? (("*") x $args) : '...');
+ my @parts = (defined($endpoint->attributes->{Args}[0]) ? (("*") x $args) : '...');
my @parents = ();
my $parent = "DUMMY";
my $extra = $self->_list_extra_http_methods($endpoint);
push(@rows, [ '', $name ]);
}
- if(defined $endpoint->number_of_args) {
- if($endpoint->has_args_constraints) {
- my $tc = join ',', @{$endpoint->args_constraints};
- $endpoint .= " ($tc)";
- } else {
- $endpoint .= " (${\$endpoint->number_of_args})";
- }
+ if($endpoint->has_args_constraints) {
+ my $tc = join ',', @{$endpoint->args_constraints};
+ $endpoint .= " ($tc)";
+ } else {
+ $endpoint .= defined($endpoint->attributes->{Args}[0]) ? " ($args)" : " (...)";
}
push(@rows, [ '', (@rows ? "=> " : '').($extra ? "$extra " : ''). ($scheme ? "$scheme: ":'')."/${endpoint}". ($consumes ? " :$consumes":"" ) ]);
my @display_parts = map { $_ =~s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; decode_utf8 $_ } @parts;
sub link2_int :Chained(link_tuple) PathPart('') CaptureArgs(UserId) { }
+ sub finally2 :GET Chained(link2_int) PathPart('') Args { $_[1]->res->body('finally2') }
sub finally :GET Chained(link2_int) PathPart('') Args(Int) { $_[1]->res->body('finally') }
sub default :Default {
is $res->content, 'default';
}
-=over
+{
+ my $res = request '/chain_base/1/2/3/3/3/6';
+ is $res->content, 'finally';
+}
+
+{
+ my $res = request '/chain_base/1/2/3/3/3/a';
+ is $res->content, 'finally2';
+}
-| /chain_base/*/*/*/*/*/* | /chain_base (1) |
-| | -> /link_tuple (3) |
-| | -> /link2_int (1) |
-| | => /finally (missing...) |
+{
+ my $res = request '/chain_base/1/2/3/3/3/6/7/8/9';
+ is $res->content, 'finally2';
+}
+
+=over
+| /chain_base/*/*/*/*/*/* | /chain_base (1) |
+| | -> /link_tuple (Tuple[Int,Int,Int]) |
+| | -> /link2_int (UserId) |
+| | => GET /finally (Int)
=cut
{