You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the RestController, it implements using a PathTrie with a wildcard defined (*) and internally checks (and throws exception) for conflicting parameterized names with the same wildcard. So this shouldn't be too hard to implement.
We can replace {foo} with * in the "exact match" map, and do that same translation of the URI when checking against the map. When inserting in the map we need to do a check whether it's already registered with a different action and return an exception.
dbwiddis
changed the title
[FEATURE] Support parameterized routes
[FEATURE] Support Routes with named wildcards
Sep 2, 2022
While insertion is easy with the *, checking an incoming REST action vs. the map is slightly more complicated as it will have text rather than an asterisk. Might be useful to have two maps: one for exact matches (easy lookup) and one with the wildcards.
When an incoming request comes in, first check the exact map. If no match, then iterate over the map's entryset and attempt a key using glob matching with PathMatcher.
Is your feature request related to a problem?
Originally posted by @cwperks in #111 (comment)
What solution would you like?
We need to change the matching in the
ExtensionsRunner
hashmap from exact, to parsing a request URI and allowing "wildcard" parameters.What alternatives have you considered?
Java's path glob matching is probably a great fit here. I'll dig through Rest Handler code to see if that's how it's done there.
The text was updated successfully, but these errors were encountered: