Paths cannot contain `:`
See original GitHub issueActual behavior (the bug)
app.get("/path/to/resource:action")
Exception in thread “main” java.lang.IllegalArgumentException: Path ‘/path/to/resource:action’ invalid - Javalin 4 switched from ‘:param’ to ‘{param}’
Expected behavior
A handler to be registered at the path /path/to/resource:action
To Reproduce See “Actual behavior (the bug)”
Additional context
PathParser.kt
seems to specifically check for this character and throw the exception, apparently in an attempt to warn people of changed behavior. This unfortunately interferes with what I think ought to be acceptable handler registration.
if (rawPath.contains(":")) {
throw IllegalArgumentException("Path '$rawPath' invalid - Javalin 4 switched from ':param' to '{param}'.")
}
While I understand the desire to make life a little easier in migration situations, I don’t think that should interfere with the future in this way.
By way of example, here’s a documented use-case for a :
within a URL path
https://cloud.google.com/apis/design/custom_methods
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
Turns out setting that up wasn’t as time consuming as I had expected. Kotlin isn’t my traditional stomping ground
Happy to hear that !