This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-02
Channels
- # announcements (2)
- # babashka (21)
- # beginners (80)
- # bristol-clojurians (1)
- # calva (1)
- # cider (4)
- # clara (2)
- # clj-kondo (5)
- # cljs-dev (41)
- # clojure (8)
- # clojure-dev (2)
- # clojure-europe (28)
- # clojure-italy (11)
- # clojure-nl (4)
- # clojure-spec (13)
- # clojure-sweden (1)
- # clojure-uk (11)
- # clojuredesign-podcast (5)
- # clojurescript (5)
- # code-reviews (4)
- # cursive (25)
- # data-science (5)
- # datomic (25)
- # duct (15)
- # emacs (6)
- # fulcro (13)
- # graalvm (1)
- # graphql (5)
- # helix (2)
- # jobs (3)
- # jobs-discuss (4)
- # luminus (1)
- # malli (13)
- # meander (3)
- # off-topic (16)
- # pathom (2)
- # pedestal (1)
- # re-frame (5)
- # ring-swagger (3)
- # spacemacs (4)
- # sql (16)
- # tools-deps (1)
- # tree-sitter (8)
- # vrac (2)
- # xtdb (16)
- # yada (2)
@jhacks documented the dependency to README and made it fail better: https://github.com/metosin/malli/commit/5c3689fd42f2c73253a0f81a88b23e20a3b6417b
I believe regal has regex generators for both clj & cljs, could use that instead. It’s still wip according to README: > The following aspects have known issues or are otherwise untested or incomplete, and you can expect them to change significantly as we further develop them: > * Creating test.check generators from regal forms
maybe @plexus could verify the readiness there? (there is also a schema type for malli in regal, which is awesome!)
Is there something like nillable in malli? Because
(malli.core/validate [:map [:a {:optional true} string?]] {:a nil})
=> false
(malli.core/validate [:map [:a {:optional true} string?]] {})
=> true
this is rather odd to me.I’m wondering if Malli supports lazy registries. I’m guessing it should be possible with the registry protocol. Anyone know of examples?
I want to build an AWS Cloudformation validator, but I don’t want to load all schema files upfront. By doing it lazy I hope to win some startup time
Sounds like a great idea. Just implement something lazy behind malli.registry/Registry
and plug it in.
Thanks! I’ll give it a try
So the value defines what needs to be looked up. E.g. {:Type "AWS::EC2::Instance" …}
would need to be validated with the schema for "AWS::EC2::Instance"
, so I need to inspect the value before I know the type. Might make it a bit trickier
(m/validate [:maybe :string] nil)
; => true
(m/validate [:maybe :string] "sheep")
; => true
> I believe regal has regex generators for both clj & cljs, could use that instead Wow, thanks for mentioning regal, I was not aware of it: https://github.com/lambdaisland/regal#use-with-malli