This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-01
Channels
- # beginners (10)
- # cljs-dev (33)
- # cljsjs (4)
- # cljsrn (12)
- # clojure (39)
- # clojure-belgium (2)
- # clojure-russia (80)
- # clojure-spec (9)
- # clojure-uk (6)
- # clojurescript (22)
- # core-async (141)
- # cursive (2)
- # datomic (20)
- # devops (1)
- # emacs (20)
- # hoplon (1)
- # jobs (3)
- # lambdaisland (12)
- # leiningen (3)
- # lumo (44)
- # onyx (2)
- # pedestal (1)
- # quil (1)
- # re-frame (9)
- # reagent (4)
- # robots (1)
- # rum (3)
- # spacemacs (5)
- # uncomplicate (80)
- # untangled (46)
- # yada (2)
I know yada can use ring handlers, but is there a way to add yada resources "annotations" to a ring handler? For example I want to reuse a ring handler function but also add parameter validation, swagger annotation etc.
Another unrelated question. It seems that transit+json behaves differently as transit+msgpack
(update (yada/response-for (yada/resource {:methods {:get {:produces [{:media-type #{"application/transit+msgpack"
"application/json;q=0.9"
"application/transit+json;q=0.8"}
:charset "UTF-8"}]
:response (fn [ctx]
{:content "some-content"})}}})
:get
"ignore-me"
{:headers {"accept" "application/transit+msgpack"
;; replace with transit+json and it works
}})
:body (fn [s]
(yada.request-body/parse-stream "application/transit+msgpack" s)
;; replace with transit+json and it works
)) ;; body is - 17, but is {:content "some-content"} with transit+json