This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-19
Channels
- # babashka (39)
- # beginners (58)
- # calva (45)
- # clerk (9)
- # cljsrn (10)
- # clojure (23)
- # clojure-denver (13)
- # clojure-europe (39)
- # clojure-norway (6)
- # clojurescript (10)
- # clr (3)
- # cursive (5)
- # data-science (6)
- # datomic (27)
- # events (1)
- # fulcro (33)
- # graphql (5)
- # hyperfiddle (24)
- # introduce-yourself (4)
- # kaocha (1)
- # malli (8)
- # off-topic (23)
- # pedestal (5)
- # re-frame (2)
- # releases (4)
- # shadow-cljs (8)
- # xtdb (12)
Should this work?
(-> (m/schema ::my-schema {:registry {::my-schema string?}})
m/ast
m/from-ast)
...because it doesn't seem to. throws malli.core/invalid-schema
b/c the m/ast
call returns {:type :malli.core/schema, :value :full.ns/my-schema}
(pretend I merged in malli.core/predicate-schemas
)
You need to pass the registry to all of the calls:
(let [opts {:registry (merge (m/default-schemas) {::my-schema string?})}]
(-> (m/schema ::my-schema opts)
(m/ast opts)
(m/from-ast opts)))
This also works:
(m/from-ast
(m/ast
[:schema {:registry {::my-schema string?}}
::my-schema]))
ah, thanks!
hmm, that doesn't fix it for me. same error. same return value from m/ast