This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-06
Channels
- # aleph (79)
- # bangalore-clj (3)
- # beginners (49)
- # boot (74)
- # cider (10)
- # cljs-dev (21)
- # cljsrn (2)
- # clojure (105)
- # clojure-berlin (1)
- # clojure-brasil (1)
- # clojure-dusseldorf (1)
- # clojure-korea (1)
- # clojure-poland (3)
- # clojure-russia (38)
- # clojure-spec (146)
- # clojure-uk (20)
- # clojurescript (70)
- # cloverage (1)
- # component (1)
- # core-async (23)
- # css (16)
- # cursive (22)
- # datascript (1)
- # datomic (22)
- # defnpodcast (6)
- # emacs (60)
- # events (1)
- # hoplon (94)
- # jobs (1)
- # jobs-rus (13)
- # luminus (11)
- # off-topic (11)
- # om (48)
- # onyx (5)
- # proton (7)
- # re-frame (87)
- # reagent (39)
- # rethinkdb (1)
- # ring-swagger (14)
- # rum (6)
- # specter (14)
- # untangled (105)
- # vim (6)
- # yada (22)
Out of curiosity: yada is using Prismatic Schema...
1/ how to handle custom predicates (if possible at all)? For example, if I want to make sure something is a valid UUID, I have a function valid-uuid?
. However, using this function:
error converting to swagger schema [:message predicate$valid_uuid_QMARK_@7e7f769]
which makes sense, but can I make this valid (like: show it as a String on the front-end, validate it as UUID in the backend)?
2/ Are there any plans (in the near, or far future 🙂 ) to have a clojure.spec
version of yada?@kurt-yagram there is the s/Uuid
and you can use custom predicates with s/constrained
, like (s/constrained s/Str valid-uuid?)
. Ring-swagger grabs the type from the first argument (rules here: https://github.com/metosin/ring-swagger#out-of-the-box-supported-schema-elements). Related - there is a open clojure hacking session here in Finland tomorrow, one goal is to get the spec->json-schema finalized & spec runtime coercions to work properly. Will be pushed to ring-swagger.
cool!
Hi @kurt-yagram - I've had a similar issue recently wanting a parameter to be a (base64) string for json, but binary data for multipart/form-data.
2. Yes, the plan is to adopt clojure.spec quite soon. Ring-swagger is already well on the way, which is where yada gets much of its swagger support from.
That's wicket-awesome. Thx @ikitommi @malcolmsparks .
Is it possible to define a set of values that are valid in swagger? I mean, I tried something like: {:parameters {:path {:par #{"val1", "val2"}}}
, hoping that in swagger, I would get a dropdown list of values. This doesn't seem to work, though...
Is it possible to update a running Yada listener with new routes?
It's possible, but you'd have to write your own dynamic equivalent of bidi's find-handler
I'll take a look into that. Thanks!
@kurt-yagram try s/enum
cool, that does the trick
hey guys, there is some internal yada error it seems that it renders a 500 error if you send any Accept-Charset header at all
since we don't do anything special with charsets (other than telling yada we accept /), does this hint at an actual bug in yada ?
looking at the exception, it looks like it tries to coerce something into UTF8 that returns nil, and tries to coerce that into json?
Yes, it looks like a bug.
Sorry for the poor response, I've been at a conference all day