This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-28
Channels
- # beginners (8)
- # boot (49)
- # cljs-dev (29)
- # cljsrn (9)
- # clojure (238)
- # clojure-dev (3)
- # clojure-gamedev (1)
- # clojure-italy (7)
- # clojure-norway (11)
- # clojure-russia (39)
- # clojure-sanfrancisco (3)
- # clojure-spec (116)
- # clojure-sweden (2)
- # clojure-uk (53)
- # clojurescript (90)
- # cursive (13)
- # datomic (12)
- # defnpodcast (2)
- # dirac (1)
- # emacs (11)
- # figwheel (2)
- # hoplon (15)
- # jobs (3)
- # jobs-discuss (48)
- # keechma (1)
- # klipse (4)
- # leiningen (16)
- # luminus (4)
- # lumo (49)
- # mount (10)
- # off-topic (1)
- # om (13)
- # onyx (15)
- # pedestal (67)
- # perun (1)
- # planck (16)
- # powderkeg (33)
- # proton (1)
- # protorepl (2)
- # re-frame (16)
- # reagent (4)
- # ring (9)
- # ring-swagger (10)
- # rum (5)
- # slack-help (1)
- # spacemacs (1)
- # uncomplicate (15)
- # untangled (19)
- # yada (58)
Do you mean (isa? (class '()) compojure.response/Renderable)
According to the docstring it looks like isa?
expects classes, not an instance and a class… (I don’t recall ever using isa?
myself)
you’re right, I meant to do (instance? clojure.lang.ISeq '())
…which evaluates to true. So now I’m not sure why what I had wasn’t working
What do you mean by “isn’t returning '()”?
@alex.ter.weele If '() is in your response body, your body is empty.
sorry for not including more detail. I have endpoints like this:
(GET "/list" _ (ok ()))
(GET "/vec" _ (ok []))
The first will return an empty body. Looking at how compojure.response/render
works, I see that returning an empty body is the intended behavior.
(My problem is that I’m used to the extra behaviors of compojure-api, which would take a result like this and make it into an empty JSON list.)
The second one is a little confusing. When I hit it, I get a 500 with an error message (from Jetty, maybe) in the body, saying "Unrecognized body: []”. Seems like render
doesn’t handle that type.
Now that I know this, I can get around it by putting write-json
in the right place. Thanks for the help!