Hello, while trying to use compojure-api, I have a question about exactly how to use this. In readme there is some examples,
@wontheone1 uploaded a file: https://clojurians.slack.com/files/U354VUKQA/F8JRHR9CH/-.clj
@wontheone1 uploaded a file: https://clojurians.slack.com/files/U354VUKQA/F8L795EKG/-.clj
I assumed these are interchangeable alternatives. I want to use the data-driven approach (the first one). but there is no "path" (like "/hello-async") in the second example. I'd like an example with data-driven approach where a path is included, if possible please 🙂
Thank you in advance!
I found how to add paths in data-driven way 🙂 they had to be nested in
context as in https://github.com/metosin/compojure-api/blob/master/examples/resources/src/example/handler.clj
Hi, I was testing a Get endpoint made with compojure-api with Midje & Ring mock. I found something weird.
@wontheone1 uploaded a file: https://clojurians.slack.com/files/U354VUKQA/F8JSZPTGR/-.clj
Here I am expecting JSON in
:body but I am getting inputstream. Also
:compojure.api.meta/serializable? true part is not something I am expecting... Though when I make http calls with POSTMAN(curl substitute) then I get expected response. Is this expected behavior?
I would like to know how do you test endpoints by compojure-api in real world applications...
about inputstream in body, I forgot that I had to slurp (because with techstack I use in my company, the body is already string without slurp, so I never had to slurp the body in tests). Now that I slurp and
parse-string the body is as expected. but still I wonder what's the purpose of