ring-swagger & compojure-api
jdt 2018-08-21T11:50:05.000100Z

This is a little weird. I have one app with :spec coercion, but I get these message when logging: `

jdt 2018-08-21T11:50:10.000100Z

2018-08-21 07:48:58,805 [main] INFO  [compojure.api.coercion.schema] - :schema coercion enabled in compojure.api
2018-08-21 07:48:59,218 [main] INFO  [compojure.api.coercion.spec] - :spec coercion enabled in compojure.api

jdt 2018-08-21T11:50:26.000100Z

the weird one being the :schema coercion message

jdt 2018-08-21T11:56:02.000100Z

I'm still struggling with this. I'm guessing it isn't compojure-api, though the fact remains that while my endpoint is invoked and the response returned from my GET form, the client can never read the response. I built a standalone software project with all the same dependencies to also return an sse channel response, and that worked, so clearly compojure-api works with the as-channel response. But in my production app the clients, any client, can't read the response. They connect, but not enough gets flushed for them to read the response (e.g. :status), and so they hang. Checking stale build artifacts now, every so often lein does stuff wrong, we'll see what happens.

jdt 2018-08-21T13:23:29.000100Z

I have a workaround. If I transmit, from the server, any text to the SSE channel, then the client gets a response and all things work well. As this is an SSE channel I can just send a comment. But in the standalone app I tested with the same dependencies it was not necessary, and should not be necessary. Somehow there seems to be something conditional going on up the stack from the GET return that decides what gets flushed and when. It's returning a chunked response, perhaps it should not be returning a chunked response. Still a mystery but I have a workaround for now.

ikitommi 2018-08-21T15:45:44.000100Z

there is a multimethod that is used to map Keyword :coercion values, e.g. :coercion :schema. The logging was added before Clojure 1.9.0 to indicate which coercion implementations are available (e.g. if spec is found in classpath). I think the logging can be removed, as 1.9.0 has shipped.

ikitommi 2018-08-21T15:46:27.000100Z

Pull Request to remove those most welcome.

ikitommi 2018-08-21T16:11:52.000100Z

oh, yes, c-api generates that when requested

vuuvi 2018-08-21T17:41:31.000100Z

yeah I didn’t understand that at all, it might be helpful to explain that to users when they’re just starting out so they aren’t searching for something that will never exist 😄