silk
silk copied to clipboard
AbstractMethodError from README example
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?
Thanks for the report, @AdamFrey. I just pushed 1.1.2
to Clojars. It resolves this issue for me. Try it out.
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