This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-24
Channels
- # beginners (19)
- # boot (118)
- # capetown (4)
- # cider (37)
- # cljs-dev (69)
- # cljsjs (23)
- # clojure (212)
- # clojure-austin (10)
- # clojure-india (3)
- # clojure-italy (2)
- # clojure-mke (1)
- # clojure-nl (1)
- # clojure-russia (5)
- # clojure-spec (52)
- # clojure-uk (86)
- # clojurescript (31)
- # core-async (9)
- # cursive (123)
- # datomic (91)
- # emacs (22)
- # events (3)
- # hoplon (68)
- # klipse (4)
- # lambdaisland (10)
- # leiningen (2)
- # off-topic (14)
- # om (14)
- # onyx (44)
- # perun (14)
- # proton (20)
- # re-frame (15)
- # reagent (10)
- # ring-swagger (9)
- # specter (18)
- # untangled (3)
- # vim (26)
- # yada (4)
I have a need to do multiple restructure-params
calls on many routes and I’m hoping someone can help me figure out a clean way. Ideally I would like have a single key to restructure, say :respond-with [Schema]
and from that I’d like to set/restructure the :return
, :query-params
& :body
values.
All the routes in question behave the same way and I want to wrap the route body in a function that can take the results of the route body and then sort/filter/paginate through them… For that I need the query params… And I need to update the return schema because I return metadata on the state of the sort/filter/paginate options
I tried calling (restructure-params :query-params [{page :- Int 1} …] acc)
while restructuring :respond-with
and clojure blows up because of the letk syntax and I don’t know how to wrangle that… So I kinda stopped there
I think it might be easier to model with a resource
. There is a example on https://github.com/metosin/compojure-api/tree/master/examples/reusable-resources
Thanks for the hint! I’ll have a look and report back 🙂
cool. The swagger docs can't keep uo if the models are created at runtime thou. Swagger is for static docs. The simpler example is here: https://github.com/metosin/compojure-api/blob/master/examples/resources/src/example/handler.clj
Where can I find the docs on what options I can provide to GET
, POST
, DELETE
, etc? I have one path parameter that is an Uuid and I want to provide an example in the swagger UI. Is that possible?
there is a wiki page for those: https://github.com/metosin/compojure-api/wiki/Endpoints. Examples can be added with ring-swagger helpers: https://github.com/metosin/ring-swagger/blob/master/README.md#adding-description-to-schemas
If someone has extra time, this would be awesome for documentation: https://github.com/metosin/compojure-api/issues/268