silk icon indicating copy to clipboard operation
silk copied to clipboard

AbstractMethodError from README example

Open AdamFrey opened this issue 9 years ago • 2 comments

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?

AdamFrey avatar Feb 09 '16 20:02 AdamFrey

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

domkm avatar Feb 11 '16 05:02 domkm

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

AdamFrey avatar Feb 11 '16 19:02 AdamFrey