This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-08
Channels
- # bangalore-clj (4)
- # beginners (88)
- # boot (12)
- # cljs-dev (10)
- # cljsjs (1)
- # clojure (284)
- # clojure-denmark (2)
- # clojure-dev (35)
- # clojure-italy (8)
- # clojure-russia (36)
- # clojure-spec (38)
- # clojure-uk (51)
- # clojurescript (145)
- # cursive (6)
- # data-science (1)
- # datomic (8)
- # duct (43)
- # emacs (9)
- # figwheel (2)
- # fulcro (29)
- # graphql (1)
- # immutant (3)
- # instaparse (1)
- # jobs (1)
- # jobs-discuss (1)
- # lumo (16)
- # off-topic (50)
- # onyx (90)
- # re-frame (6)
- # reagent (20)
- # remote-jobs (3)
- # ring-swagger (18)
- # schema (8)
- # shadow-cljs (141)
- # slack-help (3)
- # spacemacs (36)
- # unrepl (7)
- # vim (1)
- # yada (2)
each of my services publishes their schemas under a certain endpoint convention and my clients can consume those (since the schemas often are more complex than what can be represented by swagger)
right we define all our schemas in a shared utility library
i’m more talking about coercing the json response from one of our services into clojure datastructures using a given schema
right now we manually call ring.swagger.schema/coerce! on the json response and pass it the relevant schema
just seemed like something someone might have built a library for
It would be cool if schemas & specs would have symmetric encode & decode, so they could be used over the wire. Spec gets close with this.
Something related: https://github.com/metosin/compojure-api/issues/148 & https://github.com/oliyh/martian
well i’m imagining a wrapper around clj-http that could take a :responses map like you define in your api and automatically coerce the json for you
nice, martian looks close
yeah the problem with using swagger directly is you lose the schema part
the main reason we use coerce! is to convert date/money strings back into joda time/money objects
which swagger can’t represent
If the client can access the some shared schema/spec namespaces, it would be possible to create a martian-style client for schema/spec.
yeah all schema is shared in a utility library
definitely gonna look into martian
yeah i think the main issue with martian is it doesn’t support async yet