playframework / playframework/playframework
When you cannot match a type in routes file, return 404 rather than 400
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 12.6k
- Forks
- 4k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 29
Description
I have this route:
GET /player/proxy/:what controllers.Player.proxy(what: Char)
If I want to pass more than 1 character for :what, I get this response:
(400,Cannot parse parameter what with value '3a' as Char: what must be exactly one digit in length.)
It would make much more sense to consider the route unmatched, continue traversing the rest of the routes, and return 404 at the end if nothing matches.
I would also like to hear everyone's opinions.
Contributor 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.
Research direction
Start by tracing route matching and typed parameter parsing for the route shown in the issue. Check how a failed Char conversion is classified and whether matching can continue to later routes. Done means an overlong value does not produce a 400 from this route and instead reaches a matching route or ends as a 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100