This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-13
Channels
- # admin-announcements (48)
- # alda (1)
- # aws (24)
- # beginners (4)
- # boot (103)
- # cider (69)
- # clojure (111)
- # clojure-art (5)
- # clojure-dev (35)
- # clojure-greece (2)
- # clojure-nl (3)
- # clojure-russia (1)
- # clojure-shanghai (1)
- # clojurescript (220)
- # clojurescript-ios (1)
- # clojurewerkz (3)
- # community-development (3)
- # core-logic (5)
- # cursive (5)
- # datomic (24)
- # devcards (21)
- # editors (3)
- # funcool (1)
- # hoplon (20)
- # ldnclj (47)
- # ldnproclodo (1)
- # liberator (1)
- # off-topic (7)
- # om (21)
- # onyx (36)
- # reagent (1)
- # ring-swagger (2)
- # spacemacs (38)
- # yada (17)
@stijn - yes, it's possible. All the tests pass on master, but of course that may not be sufficient. Is there a something you need to work that you can send me so I can take a look?
I'll try to create a minimal example where I see the problem, but for now, I see s/enum, java.util.UUID and s/Keyword that are not being coerced
@malcolmsparks: about merge-options, is that OK to create a deep-merge?
Yes, in fact it's only really an example of what you can do with a general pre-walk or post-walk of the tree. I suggest you manipulate the tree in the way you want, and if you think it's worth promoting the logic to others, submit it to me and I'll add it to the code-base
I have another question (about bidi): let's say I want to create an endpoint that redirects /news to /media?type=news, is there a standard way of doing this, or should I create something like the Redirect record that does this?
@malcolmsparks: this is the minimal example
(require '[yada.yada :as yada]
'[aleph.http :refer [start-server]]
'[schema.core :as s])
(start-server
(yada/yada (fn [ctx] (format "Hello %s!" (-> ctx :parameters :name)))
{:parameters {:get {:query {:name s/Keyword}}}})
{:port 3001})
same if I make it s/Int and request http://localhost:3001/?name=2
@stijn use a Redirect record, there's one in bidi - they're strictly separate resources
@stijn, thanks for those examples, I'll take a look later today
@stijn. You might need to write your own Matched record for that, take the :query-string from the request and add it to the location.
@malcolmsparks: cool, that works indeed