Closed lmasarati closed 5 years ago
I think it's related to #77
yes, I suspected... So the sample code could be something like this?
desc "multiple route_param";
resource "api" => sub {
params(
requires('id1', type => Str, desc => "ID1")
requires('id2', type => Str, desc => "ID2"),
requires('id3', type => Str, desc => "ID3")
);
route_param 'id1' => sub {
route_param 'id2' => sub {
route_param 'id3' => sub {
get sub {
my $params = shift;
return $params;
};
};
};
};
};
Yes, exactly. Once I fix it. Unfortunately I had no time yet to work on it, but it's my priority to fix.
Here is a better example:
params requires => { name => 'id', type => Int };
route_param id => sub {
get sub { ... };
params requires => { name => 'sub_id', type => Int };
route_param sub_id => sub {
...
};
};
Also extended documentation: https://github.com/khrt/Raisin/blob/93e806c/lib/Raisin.pm#L458
Fix for #77 was merged and realised to CPAN, see Raisin 0.87
Hello, I'm wondering if an API call like this could be done and how... GET http://example/api/:id1/:id2/:id3
The goal is to receive the three route_param id1, id2 and id3 in the get sub {} and then process them as needed... Thanks.