Fork me on GitHub
#ring-swagger
<
2017-09-01
>
ikitommi06:09:25

@plins I think not, the routing is inherited from Compojure, which uses Clout (https://github.com/weavejester/clout). If you can make it to accept empty path-params, it could be done.

bja17:09:34

@plins @ikitommi I think you might be able to do it with a regex that matches a zero length item OR some other pattern

bja17:09:07

something like #"(^$)|(\d+)" (untested)

bja17:09:14

I guess that's what * does

bja17:09:25

so maybe just (\d*)

bja17:09:35

which would match 0 or more numbers

bja17:09:58

user> (clout/route-matches "/user/:id{\\d*}" (m/request :get "/user/121"))
{:id "121"}
user> (clout/route-matches "/user/:id{\\d*}" (m/request :get "/user/"))
{:id ""}