This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-15
Channels
- # announcements (2)
- # aws (52)
- # beginners (326)
- # cider (24)
- # clara (7)
- # clj-kondo (14)
- # cljs-dev (175)
- # clojure (183)
- # clojure-ecuador (2)
- # clojure-europe (4)
- # clojure-italy (11)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-spec (5)
- # clojure-sweden (5)
- # clojure-uk (103)
- # clojurescript (49)
- # cursive (29)
- # data-science (9)
- # datascript (17)
- # datomic (23)
- # emacs (6)
- # events (4)
- # fulcro (19)
- # graalvm (8)
- # graphql (2)
- # hoplon (36)
- # jobs (1)
- # jobs-discuss (92)
- # juxt (3)
- # luminus (10)
- # off-topic (4)
- # pedestal (8)
- # planck (1)
- # re-frame (59)
- # reagent (1)
- # reitit (22)
- # rewrite-clj (8)
- # ring-swagger (3)
- # shadow-cljs (101)
- # spacemacs (15)
- # tools-deps (36)
- # vim (68)
There is some lib that takes swagger "original" description (usually as json) and builds a route for me? something like lacinia does:
(def star-wars-schema
(-> "schema.edn"
slurp
edn/read-string
(attach-resolvers {:get-hero get-hero
:get-droid (constantly {})})
schema/compile))
@souenzzo good question, currently there are no tools, looking forward on someone doing those.
biggest thing is to create mappings from swagger json schema => spec/schema. actual path mappings should be easy.
There is also https://github.com/zalando-stups/swagger1st, which does the runtime mapping. I think there is a lot to learn from that (haven’t used, but know it exists)
wrote issue on that: https://github.com/metosin/reitit/issues/272, help most welcome.
hmm, I'm having problems compiling a route which contains the following parameters schema (using plumatic for coercions)
:parameters {:body [String]}
- I get an error from deep in meta-merge, which I'll post on a thread. Here's the top line: Execution error (ExceptionInfo) at reitit.exception/exception (exception.cljc:16).
Don't know how to create ISeq from: java.lang.Class
I guess first question - I don't see any examples using non-map structures in that position, is that unsupported?@j0ni that is supposed to work. Could you minify a non-working router setup to reproduce this?
@j0ni it might be because you have a map body spec defined closer to the root. like this:
(r/router
["/kikka"
{:parameters {:body {:id s/Str}}}
["/kakka"
{:parameters {:body [s/Str]}}]])
in that, the meta-merge tries to merge a map and a vector and fails on: Don't know how to create ISeq from: java.lang.Class
how to fix: hint meta-merge to override with value:
(r/router
["/kikka"
{:parameters {:body {:id s/Str}}}
["/kakka"
{:parameters {:body ^:replace [s/Str]}}]])
definitely - but thank you, and I expect this will de-mystify future similar encounters 🙂