Fork me on GitHub
#ring-swagger
<
2017-12-27
>
wontheone110:12:35

I found one example with multiple responses definitions, https://github.com/metosin/compojure-api/blob/master/examples/thingie/src/examples/thingie.clj#L105. But would there be a way to have same status codes but different schema ? (I know it's not the best thing to do but just wondering)

wontheone110:12:11

Could I please show an example of having multiple response model with json response ?

wontheone110:12:48

I am not sure if I am doing something wrong or there s bug :)

wontheone118:12:17

Hi I got the multiple responses thing working the problem was elsewhere ! sorry about that.

wontheone118:12:21

One thing I cannot find any example is ... specifying responses that has no body

wontheone118:12:25

{:status 201} for example. I don't want to return any bodies. I tried the following things but they broke Swagger UI. So for now I am just putting there a dummy schema that's not really necessary for me

wontheone118:12:15

specifying no-body responses supported in compojure-api? how do you do that ? thank you. (sorry for massive amounts of messages)

hawari.rahman1703:12:12

Hi @, since compojure-api built on top compojure, and with that, ring, any valid ring response map will suffice.

{:status 204
 :headers {}
 :body ""}
You might want to learn more about it here https://github.com/ring-clojure/ring/wiki/Concepts

wontheone114:12:58

@ Yes; I know how to construct ring response with map but my question was about how do you define schema for response with no body for Swagger. Thank you. I see @ suggested workaround for my problem below !

hawari.rahman1703:12:50

Ah I see, I'm sorry that I misunderstood your question