We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/items/:id
/items/
(require '[reitit.core :as r]) (def router (r/router [["/items" ::list] ["/items/:id" ::item]])) ;; => #'user/router (r/match-by-path router "/items") ;; => #reitit.core.Match{:template "/items", :data {:name :user/list}, :result nil, :path-params {}, :path "/items"} (r/match-by-path router "/items/") ;; => #reitit.core.Match{:template "/items/:id", :data {:name :user/item}, :result nil, :path-params {:id ""}, :path "/items/"}
(:id path-params)
""
In the Clojure Slack #reitit channel Ikitomni had tested it against Compojure and bidi. They shared the compojure behavior:
(require '[compojure.core :as c]) ((c/GET "/kikka/:id" [] "kikka") {:request-method :get, :uri "/kikka/1"}) ; => {:status 200, :headers {"Content-Type" "text/html; charset=utf-8"}, :body "kikka"} ((c/GET "/kikka/:id" [] identity) {:request-method :get, :uri "/kikka/"}) ; => nil
The text was updated successfully, but these errors were encountered:
Should be fixed in #191.
Sorry, something went wrong.
Awesome, thanks!
No branches or pull requests
REPRODUCTION
/items/:id
/items/
EXAMPLE:
EXPECTED
/items/
should not match the/items/:id
path.ACTUAL
/items/
matched the/items/:id
path and the(:id path-params)
is an empty string""
.OTHER NOTES
In the Clojure Slack #reitit channel Ikitomni had tested it against Compojure and bidi. They shared the compojure behavior:
The text was updated successfully, but these errors were encountered: