This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-21
Channels
- # announcements (14)
- # aws (8)
- # babashka (3)
- # babashka-sci-dev (41)
- # beginners (78)
- # calva (15)
- # cider (9)
- # clj-commons (10)
- # clj-kondo (5)
- # cljs-dev (8)
- # clojure (47)
- # clojure-bay-area (3)
- # clojure-europe (13)
- # clojure-nl (2)
- # clojure-norway (15)
- # clojure-uk (13)
- # clojured (2)
- # clojurescript (20)
- # conjure (29)
- # cursive (4)
- # emacs (19)
- # events (3)
- # funcool (13)
- # hyperfiddle (16)
- # jobs (2)
- # lsp (4)
- # malli (13)
- # meander (1)
- # missionary (2)
- # nrepl (7)
- # off-topic (68)
- # other-languages (82)
- # polylith (1)
- # reagent (28)
- # reitit (12)
- # releases (3)
- # remote-jobs (5)
- # ring (27)
- # sci (6)
- # shadow-cljs (9)
- # spacemacs (2)
- # sql (10)
- # tools-deps (10)
- # vim (10)
I'm wondering, after looking at the examples, I still can't really figure out how to decode a string into lowercase. I have something like this:
(def foo [:map
{:closed true}
[:name [:string {:max 256 :error/message "should be at most 256 characters"}]]
[:email-address [:string {:decode/string 'clojure.string/lower-case :min 5 :max 100 :error/message "should be between 5 and 100 characters"}]]])
(m/validate foo {:name "foo" :email-address ""}) ;; true
(m/decode signup-request {:name "foo" :email-address ""} mt/json-transformer) ;; {:name "foo", :email-address ""}
What my objective is (in tandem with reitit), is to ensure that the email address coming in is all in lowercase. Bit of a puzzler.
(m/decode signup-request {:name "foo" :email-address "
Hi, I am looking at this example:
(m/validate [:alt keyword? string?] ["foo"]) ; => true
and I am wondering why it works that way, why not:
(m/validate [:alt keyword? string?] "foo") ; => true
(the second one says false
which means the alt thing actually makes it look for a sequence for some reason, how can I use :alt
without a vec/seq?)