Routes with mixed inline regexs and tokens
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the proposed regression case in t/classes/Dancer2-Core-Route/match.t and reproduce the failure for the mixed inline-regex and token route. Read the token-assignment code in lib/Dancer2/Core/Route.pm around lines 115-141 to understand how captures are assigned. Done means the route maps id to else, keeps some in splat, and the regression test passes.
Written by the indexing model from the issue text.
Description
When working on #1641, I planned on adding a test case for get '/(any|some)/thing/:id => sub {...}; to t/classes/Dancer2-Core-Route/match.t, which fails :(
+ [
+ [ 'get', '/(any|some)/thing/:id', sub {61} ],
+ '/some/thing/else',
+ [ { id => 'else', splat => ['some'] }, 61 ]
+ ],
The route matching code extracts the values some and else from the path; but the route regexp only has one regex with a comment. The token assignment iterates through the regex captures starting with those with comments first, assigning the rest to splat. This results in the params { id => 'some', splat => ['else'] } .. which is just wrong.
After some though, I still do not have a way to "fix" this. Creating this issue as a reminder to myself, or in hope someone else may pick it up 🤞 .
- Dominant language
- Perl
- Stars
- 604
- Forks
- 287
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerlDancer/Dancer2
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
PerlDancer/Dancer2#1854 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1851 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PerlDancer/Dancer2#1850 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
PerlDancer/Dancer2#1820 ·
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PerlDancer/Dancer2#1819 ·
All issues in PerlDancer/Dancer2
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
major/MySQLTuner-perl#1007 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
bioconda/bioconda-recipes#70187 ·
Maintainers usually reply within 2 days
-
documentation Needs Triage
Difficulty 1/5 Under an hour Newbie friendliness 93/100
Maintainers usually reply within 1 day