This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-27
Channels
- # adventofcode (3)
- # aws (1)
- # beginners (79)
- # boot-dev (1)
- # clara (50)
- # cljs-dev (7)
- # clojure (60)
- # clojure-austin (1)
- # clojure-germany (1)
- # clojure-greece (1)
- # clojure-russia (3)
- # clojure-spec (43)
- # clojure-uk (1)
- # clojurescript (76)
- # data-science (1)
- # datomic (26)
- # docs (2)
- # emacs (7)
- # fulcro (10)
- # hoplon (1)
- # instaparse (1)
- # lumo (3)
- # off-topic (16)
- # om (3)
- # onyx (2)
- # re-frame (3)
- # reagent (24)
- # ring-swagger (10)
- # shadow-cljs (15)
- # spacemacs (1)
- # sql (16)
- # uncomplicate (12)
- # unrepl (47)
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)
Could I please show an example of having multiple response model with json response ?
I am not sure if I am doing something wrong or there s bug :)
Hi I got the multiple responses thing working the problem was elsewhere ! sorry about that.
One thing I cannot find any example is ... specifying responses that has no body
{: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
specifying no-body responses supported in compojure-api? how do you do that ? thank you. (sorry for massive amounts of messages)
Hi @U354VUKQA, 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@U84FTP06P 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 @U055NJ5CC suggested workaround for my problem below !