ring-swagger

ring-swagger & compojure-api
wontheone1 2017-12-26T16:17:15.000168Z

Hello, while trying to use compojure-api, I have a question about exactly how to use this. In readme there is some examples,

wontheone1 2017-12-26T16:17:55.000074Z

@wontheone1 uploaded a file: https://clojurians.slack.com/files/U354VUKQA/F8JRHR9CH/-.clj

wontheone1 2017-12-26T16:18:34.000093Z

@wontheone1 uploaded a file: https://clojurians.slack.com/files/U354VUKQA/F8L795EKG/-.clj

wontheone1 2017-12-26T16:20:42.000123Z

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 🙂

wontheone1 2017-12-26T16:20:50.000043Z

Thank you in advance!

wontheone1 2017-12-26T18:35:45.000090Z

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

wontheone1 2017-12-26T19:39:18.000047Z

Hi, I was testing a Get endpoint made with compojure-api with Midje & Ring mock. I found something weird.

wontheone1 2017-12-26T19:39:39.000053Z

@wontheone1 uploaded a file: https://clojurians.slack.com/files/U354VUKQA/F8JSZPTGR/-.clj

wontheone1 2017-12-26T19:43:34.000004Z

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?

wontheone1 2017-12-26T19:44:03.000200Z

I would like to know how do you test endpoints by compojure-api in real world applications...

wontheone1 2017-12-26T23:05:58.000048Z

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 :compojure.api.meta/serializable? true