domkm / silk

Routing for Clojure & ClojureScript
222 stars 13 forks source link

AbstractMethodError from README example #25

Open AdamFrey opened 8 years ago

AdamFrey commented 8 years ago

I fired up a bare repl, required silk and silk.serve and pasted this example from the README:

(def api-routes
  (silk/routes {:api-data [["api"] {"limit" (silk/? (silk/int :limit) {:limit 100})
                                    "offset" (silk/? (silk/int :offset) {:offset 0})} (serve/POST)]}))

and the result is:

clojure.lang.Compiler$CompilerException: java.lang.AbstractMethodError, compiling:(boot.user4378993532146088720.clj:3:87)
          java.lang.AbstractMethodError:

any thoughts on why I'm seeing this?

domkm commented 8 years ago

Thanks for the report, @AdamFrey. I just pushed 1.1.2 to Clojars. It resolves this issue for me. Try it out.

AdamFrey commented 8 years ago

I no longer get the AbstractMethodError on 1.1.2, but the example still doesn't work for me:

boot.user=> (def api-routes
       #_=>   (silk/routes {:api-data [["api"] {"limit" (silk/? (silk/int :limit) {:limit 100})
       #_=>                                     "offset" (silk/? (silk/int :offset) {:offset 0})} (serve/POST)]}))
#'boot.user/api-routes
boot.user=> (silk/match api-routes {:path ["api"]})
nil
boot.user=> (silk/match api-routes {:path ["api"] :request-method :post})
nil