Vert.x Routes Wrong Behaviour when using hyphens (-) in params
See original GitHub issueDescribe the bug When using a route with param names that includes hyphen characters:
@Route(methods = HttpMethod.GET, path = "/path/:my-param")
boolean myRoute(@Param("my-param") String param) {
return true;
}
If we call our route, we will get a HTTP 404 Not Found error.
Now, if we change our route to get rid of hyphens:
@Route(methods = HttpMethod.GET, path = "/path/:myParam")
boolean myRoute(@Param("myParam") String param) {
return true;
}
Everything works fine now.
Expected behavior If there is a strong technical reason to not support hyphens, this should be documented. However, I think it should be supported. And for sure, not return HTTP Not Found 404 status.
Actual behavior It returns HTTP Not Found 404 status.
Environment (please complete the following information):
- Quarkus version or git rev: 1.12.0.Final
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Vert.x Core Manual
Vert.x will then route them to just one of the handlers registered at that address. ... Use params to return the parameters of...
Read more >Why Vertx doesn't allow query parameters based Routers
Vertx only allows defining routes/handlers based on path, not based on query parameters. I am wondering if it's intentional. Due to nature of...
Read more >Management & Monitoring - Micronaut Documentation
Micronaut is a modern, JVM-based, full stack Java framework designed for building modular, easily testable JVM applications with support for Java, Kotlin, and ......
Read more >PDF - Citrus Reference Guide
call some operation log() in the middle of our Java DSL test. ... @CitrusResource tells Citrus to inject this parameter with the according...
Read more >TextView - Android Developers
android:gravity, Specifies how to align the text by the view's x- and/or y-axis when ... android:hyphenationFrequency, Frequency of automatic hyphenation.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @Sgitario The issue here was that vert.x was not allowing the
-
symbol to be part of a variable name as it used a regular expression that mimicks the java variable naming rules. I’ve created a PR to address this and allow it:A variable must start with a letter and have a sequence of letters, numbers or
_
and-
. I guess the rule could be even more relaxed to support more characters but as it gets more complex it may also introduce a parsing tax on performance.Ok, I misunderstood the concept of path parameters. My understanding was that a path param always represents a path segment. A subtle clarification in the docs would be helpful 😉.