Folks, I have a begginer's question. I would like to test Malli, so I created a new lein project and included malli in the dependencies. I was able to run lein repl, but was unable to follow the examples on the doc page. (see image below) Am I missing something? Some pre-requisite? I tested on these two versions "0.0.1-SNAPSHOT", "0.2.1".
What does the exception preceding your REPL expressions say?
How are you starting this repl? what is in your project.clj?
Oh oh. I think maybe I know the answer. My project is also named "malli":man-facepalming:
#inception
Thank you very much. Keep up the good work. I will run some tests. The project seems really interesting!
@maciej.falski oh, that’s bad, didn’t realize that unregistered Schemas can’t be walked with the current impl of m/schema-walker
, as it tries to recreate the schmas using m/type
, which in this case is :user/over6
and not found in the registry.
Might need to add a -copy
method into Schema
protocol.
good thing is, that a per-schema -copy
is most likely near to no-op, which makes Schema walking easily order(s) of magnitude faster.
Not sure if it’s about the registry, ie:
(mr/set-default-registry!
{:string (m/-string-schema)
:over6 Over6})
=> #object[malli.registry$simple_registry$reify__4072 0x1f74f3fd "malli.registry$simple_registry$reify__4072@1f74f3fd"]
(mu/closed-schema :string)
=> :string
(mu/closed-schema :over6)
Execution error (ExceptionInfo) at malli.core/-fail! (core.cljc:79).
:malli.core/invalid-schema {:schema :user/over6}
@maciej.falski you should register it with :user/over6
so it matches the Schema definition