This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-13
Channels
- # aleph (2)
- # announcements (1)
- # beginners (133)
- # cider (29)
- # cljdoc (9)
- # cljs-dev (2)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (146)
- # clojure-dev (26)
- # clojure-europe (3)
- # clojure-italy (26)
- # clojure-japan (6)
- # clojure-nl (76)
- # clojure-spec (4)
- # clojure-uk (42)
- # clojurescript (17)
- # cursive (43)
- # datascript (1)
- # datomic (28)
- # emacs (4)
- # figwheel-main (13)
- # fulcro (26)
- # hyperfiddle (2)
- # jobs (9)
- # jobs-discuss (6)
- # leiningen (1)
- # mount (5)
- # onyx (8)
- # pathom (5)
- # pedestal (2)
- # re-frame (52)
- # reagent (21)
- # reitit (58)
- # ring-swagger (24)
- # shadow-cljs (95)
- # sql (14)
- # test-check (10)
- # yada (18)
(api
{:swagger
{:ui "/swagger"
:spec "/swagger.json"
:data {:info {:title "xxx"
:description "yyy"}
3) Can’t you define a schema for the route? (defschema Article2 (dissoc Article description))
?
@mping 2) I have one big defapi
with many nested context
. Would you use one api
per context?
3) Yeah, that would probably work. I thought I could get away with on-the-fly schemas.
that may not work because in swagger, I only see one spot at the top for the description and title
swagger makes a nice section per context. This can have a top-level :description
but this text is then used as a default description for the individual routes in the context, not as an "introductory" description.
(GET "/rate" []
:summary "Gets the rate for a given date, aggregated by confirmation date"
yes, this is shown in the route heading (`:summary`), so it's per-route, not per-context.
(def swagger-api
(api
{:swagger
{:ui "/swagger"
:spec "/swagger.json"
:data {:info {:title " services"
:description " services"}
...
:tags [{:name "processor", :description "migrations and event processor"}
{:name "ui", :description "ui services"}]
np, feel free to check the openapi docs, maybe there’s something buried: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
@the the 3, defschema
puts the Schema name, ns and description as meta-data for the Schema. normal dissoc
retains the meta-data and the docs are wrong. there are helpers for these in https://github.com/metosin/schema-tools. e..f (-> Article (st/dissoc :description)))