funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
kenny 2016-09-15T01:38:36.000016Z

@niwinz Any plans to have cool clojure.spec integration with catacumba requests? Right now I am using a multi-spec that dispatches on the :path in the context and, if the request is valid, delegates to the next handler, otherwise sends a 400 bad request. I imagine a tighter integration though -- possible through metadata or as the second or fourth param in a route. For example,

[[:prefix "api"
  ^{:catacumba/validate ::my-spec} [:get "foo" #'handlers/foo]]]
;; or
[[:prefix "api"
  [:get ::myspec "foo" #'handlers/foo]]]
;;or 
[[:prefix "api"
  [:get "foo" ::myspec #'handlers/foo]]]
Thoughts?