Fork me on GitHub
#ring
<
2017-03-28
>
seancorfield00:03:44

Do you mean (isa? (class '()) compojure.response/Renderable)

seancorfield00:03:27

According to the docstring it looks like isa? expects classes, not an instance and a class… (I don’t recall ever using isa? myself)

alex.ter.weele00:03:09

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

weavejester12:03:49

What do you mean by “isn’t returning '()”?

weavejester12:03:16

@alex.ter.weele If '() is in your response body, your body is empty.

scknkkrer16:03:55

Is there someone use docker swarm ?

scknkkrer16:03:22

My lein repl image doesn’t start.

alex.ter.weele18:03:57

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!