Fork me on GitHub
#ring-swagger
<
2017-02-03
>
nberger11:02:03

@singen: [ring-logger "0.7.7"] includes your patch. thanks!

singen11:02:35

@nberger Yes! I’m already using it, thanks!

pragmatic0r12:02:09

Hi, does anyone know why I cant use CamelCase header-parameter in compojure-api, ie. 'sessionToken does not work, but 'sessiontoken works. I always get a "missing-required-key".

nberger13:02:01

@pragmatic0r: I'm not sure exactly where and how, but header parameters are converted to lowercase. It shouldn't be an issue, because header names are case insensitive. If you just want to use the camelCase symbol in your code, I don't know if it's possible to match sessiontoken and have it as sessionToken in the (what I think is a) letk restructure. Well, reading at the end of (in known disadvantages 🙃) https://github.com/plumatic/plumbing/tree/master/src/plumbing/fnk#fnk-syntax it seems like you can could do it with [:sessiontoken :as sessionToken]. Let me know if that works, because I remember trying to do that in the past and giving up 😕

pragmatic0r13:02:41

@nberger thx for pointing this out, i will try that. meanwhile the guys at #clojure came up with this https://github.com/ring-clojure/ring/blob/master/SPEC#L100.

nberger13:02:26

@pragmatic0r cool, that explains it 🙂

pragmatic0r13:02:26

yep, this made me some headaches this morning. when you are doing JS you never think about this 🙂

nberger13:02:47

🙂 but have to think in so many other things... 😁

nberger13:02:09

btw while checking this out, I learned about the http://compojure.api.help ns, which is very nice, and found that some help-for methods had the wrong dispatch values, so I sent this PR: https://github.com/metosin/compojure-api/pull/275

pragmatic0r13:02:01

oh great. this is my first week in clojure, loving it so far. did some lisp before

nberger13:02:12

Nice. Welcome then! hope you keep loving it (I'm sure you will). Clojure is my first lisp, and I also love it since the first week 🙂

pragmatic0r13:02:14

I think I found a solution to my problem. using :middlware i can modify the header too

pragmatic0r13:02:44

works so far, im happy 🙂

miikka14:02:53

heh, double-review of @nberger's patch with @ikitommi

nberger14:02:03

I guess that's what you get when you push a PR with failing tests 😛

miikka14:02:22

Now merged 👍

plins19:02:20

hello everyone! how i can force the content-type of a response using compojure-api? inside the repl the following code works

(-> (ring/response {})
              (ring/content-type "application/vnd.ms-excel"))
but when i test with postman the content type is application/json 😕

ikitommi19:02:25

@plins try the latest alpha? It's a ring-middmeware-format issue, should be fixed when r-m-f is replaced with Muuntaja

plins19:02:54

will update deps and try! thank you for the majestic work!

ikitommi19:02:30

thanks for thanks :)

plins19:02:49

@ikitommi , the bug is fixed, yay! 🙂

plins19:02:37

I'm searching the docs on how to serve non static files with compojure-api but cant find anything that works, just some compojure examples which dont work ... I am having casting issues on how to serve a HSSFWorkbook object (POST

plins19:02:19

` (POST "/xls" [] (response (create-workbook [["title"]["value"]])))

plins19:02:43

but im getting this Unrecognized body: Name: /xl/workbook.xml - Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml

ikitommi20:02:55

@plins what are you returning from route? There isn't an example around (should be!), but normal ring rules apply. There is example in Kekkonen: https://github.com/metosin/kekkonen/blob/master/src/kekkonen/upload.clj