Hey Folks, I am facing an issue with pedestal routing in little project. My routing work fine with this:
(def routes
#{["/" :get (conj common-interceptors `home-page)]
["/locals" :post (conj common-interceptors `upsert-local!)]
["/locals/:id" :get (conj common-interceptors `find-one-local!)]})
But when I add one more route to the map, this get broken:
(def routes
#{["/" :get (conj common-interceptors `home-page)]
["/locals" :post (conj common-interceptors `upsert-local!)]
["/locals/:id" :get (conj common-interceptors `find-one-local!)]
["/locals" :get (conj common-interceptors `find-map-local!)]})
Got this error:
INFO io.pedestal.http - {:msg "GET /", :line 80}
INFO io.pedestal.http.cors - {:msg "cors request processing", :origin "", :allowed true, :line 84}
ERROR i.p.http.impl.servlet-interceptor - {:msg "Dev interceptor caught an exception; Forwarding it as the response.", :line 314}
clojure.lang.ExceptionInfo: clojure.lang.ExceptionInfo in Interceptor :io.pedestal.http.route/router - You're trying to use something as an interceptor that isn't supported by the protocol; Perhaps you need to extend it?
Here is the test I am running:
(fact "hitting home page endpoint"
(GET "/" 200) => (match {:body {:msg "Hello World!"}}))
You're using a SET #{} of vectors #{ [] [] [] [] } but in a SET every vector must be unique... is that the issue
actually it may just be the sequence.
sometimes with COMPOJURE routing I have to adjust the order of things in the list.
because it does matching sequentially
Sorry but I still don’t get what I am doing wrong
They are all unique to me, every vector in my set
are different
What’s the definition of find-map-local! ?
Maybe you aren’t returning a proper interceptor?
yeah find-map-local must be broken