This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-10
Channels
- # alda (28)
- # announcements (7)
- # beginners (79)
- # boot (62)
- # cider (11)
- # cljsjs (12)
- # cljsrn (8)
- # clojure (111)
- # clojure-art (2)
- # clojure-austin (5)
- # clojure-conj (3)
- # clojure-dev (54)
- # clojure-japan (12)
- # clojure-russia (30)
- # clojurescript (354)
- # clojurex (5)
- # cursive (9)
- # data-science (58)
- # datomic (19)
- # editors-rus (3)
- # emacs (7)
- # events (2)
- # hoplon (5)
- # ldnclj (6)
- # lein-figwheel (14)
- # luminus (1)
- # off-topic (10)
- # om (191)
- # onyx (59)
- # re-frame (30)
- # reagent (74)
- # robots (1)
- # yada (19)
I'm looking to expose the usecases of a business logic library as resources, in the first run this would mean mostly GET and POST requests being mapped to functions returning data
the problem I'm having is with returning a map from such a function call, something like
{:errors [:email-invalid}
"No implementation of method: :interpret-post-result of protocol: #'yada.methods/PostResult found for class: clojure.lang.PersistentArrayMap" when I wrap my response in a record that implements that protocol, I get a low-level conversion error saying "Don't know how to convert class ... into (stream-of io.netty.buffer.ByteBuf)"
@malcolmsparks: i'm on a slightly forked -9 atm... are there any significant api changes between there and HEAD ?
hi imre, here's an example of a resource returning a JSON object from a POST request - https://www.refheap.com/76f1fa00254c4e91244e2cf9c - the salient bit being that it's actually returning a string which has been encoded with cheshire/generate-string
I'm wondering how to utilize the multi-content-type feature of yada there, I take it you haven't found a solution to that yourself?
like when you do
(yada {:foo :bar})
it will be represented as per negotiated with the clientoh, i haven't true @imre - this app doesn't care - it's just JSON
@imre: you can ignore the with-context/mlet/return stuff ... that's async handling ... it should work just the same if you strip it out and go synchronous
here's what I came up with in case anyone has similar problems: https://gist.github.com/imrekoszo/44671357f415b05f2c49