This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-16
Channels
- # aatree (1)
- # admin-announcements (6)
- # alda (3)
- # beginners (66)
- # boot (41)
- # cider (4)
- # cljsjs (3)
- # cljsrn (18)
- # clojure (146)
- # clojure-android (2)
- # clojure-nl (1)
- # clojure-russia (35)
- # clojure-sdn (2)
- # clojure-sg (5)
- # clojure-uk (41)
- # clojurescript (116)
- # datomic (12)
- # dirac (40)
- # docker (2)
- # editors (2)
- # hoplon (85)
- # immutant (19)
- # jobs (1)
- # keechma (2)
- # lein-figwheel (8)
- # mount (33)
- # off-topic (1)
- # om (114)
- # onyx (159)
- # parinfer (24)
- # proton (3)
- # reagent (4)
- # ring-swagger (15)
- # uncomplicate (7)
- # untangled (93)
- # yada (30)
Thanks ! I get this :
Possibly confusing dependencies found:
[lein-hiera "0.9.0"] -> [org.clojure/tools.namespace "0.2.4"]
overrides
[com.jakemccrary/lein-test-refresh "0.10.0"] -> [org.clojure/tools.namespace "0.2.11" :exclusions [org.clojure/clojure]]
Consider using these exclusions:
[com.jakemccrary/lein-test-refresh "0.10.0" :exclusions [org.clojure/tools.namespace]]
Aborting due to :pedantic? :abort
@nha - check your .lein/profiles.clj
- comment out lein-hiera
that will fix it
I believe you could put lein-hiera in a profile, that way you could still use it with a with-profile but prevent it getting in the way of your normal work
I tend to use boot now too!
boot ftw!
I will migrate yada's dev profile to boot at some point, but there's more critical priorities on my todo list right now
hey, @r0man, nice to have you around
Hello, I just noticed that lazy seqs returned from a handler don't participate in content negotiation. Is this intentional, or did I hit a bug?
@r0man: can you expand a bit? I'm not sure I follow. Content negotiation happens before your response function is called. Or do you mean the result of something like (handler (range 1000))
doesn't participate in conneg?
That would be because yada can't infer anything from a lazy sequence (how could it), instead you could do (handler (resource {:response (range 1000) :produces "application/edn"}))
Mostly, the yada shorthands are fairly primitive and mostly used as tutorial pieces
I might have misunderstood you, so sorry if I did
@malcolmsparks: In my handler I fetch records from a db and they are returned in a lazy seq. When I call vec
on the seq, content negotiation works. I just expected a lazy seq would be handled the same way as a vector.
What happens when you add (extend-protocol yada.body.MessageBody clojure.lang.LazySeq (to-body [v representation] (yada.body/encode-message (yada.body/render-seq v representation) representation)))
yes, looks like a bug to me - see yada.body.clj
When I send an accept header of application/json
and return (map identity [{:a 1}])
from the handler it is returned as EDN, and not JSON as I would have expected.
Yes, it's not being encoded by the body
Content negotiation is happening though (you should see application/json as the Content-Type in the response header)
Try yada 1.1.2
Does that fix it?
@malcolmsparks: Yes, 1.1.2 works as expected. Thanks!
Cool. Thanks for the bug report!