pedestal

2019-10-09T15:53:43.003300Z

Hey, so I'm running into some behaviour that I can't quite explain. I have two routes defined in table syntax: #{["/foos/search" :get [..] :route-name :search] ["/foos/:foo-id/bar" :post [..] :route-name :bar]}; the presence of the second route makes the system return a 404 for the first. This leads me to believe they are conflicting, but both the verbs and the route-names are different? I can't seem to explain this. We are on io.pedestal/pedestal.route {:mvn/version "0.5.3"}.

ikitommi 2019-10-09T16:24:00.004Z

@dadair it's by design: > The prefix-tree router also changes some of the routing behavior. In the linear-search, you could have routes like /one/:wild and /one/two, the latter being a hard match and the former picking up any wildcard URL matches (not /one/two). In the prefix-tree, this isn't allowed, and one/:wild will always be matched. This change also encourages "best practices" and removes the possibility of subtle bugs introduced by human error.

2019-10-09T16:24:38.004700Z

@dadair refer to http://pedestal.io/reference/using-the-builtin-routers. You’ll want to use the Linear Search router instead

ikitommi 2019-10-09T16:24:41.004800Z

https://github.com/pedestal/pedestal/pull/330

2019-10-09T16:29:44.006700Z

Ah ok thank you; the reference docs on the website are a bit misleading, they state (iirc) that as long as verb and name differ, there is no collision

2019-10-09T16:29:57.007200Z

I’ll take a look at the other routers

isak 2019-10-09T16:46:29.007900Z

couldn't one just be linear for that part of the tree?