Q: is there a typo in the readme in the custom registry section? :post-int
Another one: is m/s-simple-schema
a typo? This fn doesn’t exit
welcome @kari.marttila! first one definitely a typo, could not find the latter. But PR welcome to fix any typos.
ok. I’ll make a PR for both
scratch that. I don’t know what you would use to replace the second one. I’ll PR for the typo
here’s the second one…
Custom registry
Example to create a custom registry without the default core predicates and with :bool and :pos-int Schemas:
(def registry
(merge
(m/class-schemas)
(m/comparator-schemas)
(m/base-schemas)
{:bool (m/-simple-schema {:type :bool, :pred boolean?})
:pos-int (m/-simple-schema {:type :pos-int, :pred pos-int?})}))
(m/validate [:or :bool :pos-int] 'kikka {:registry registry})
; => false
(m/validate [:or :bool :post-int] 123 {:registry registry})
; => true
m/-simple-schema
doesn’t exist as a fn. I’m not sure what you would use instead
https://github.com/metosin/malli/blob/master/src/malli/core.cljc#L211
are you using the latest version?
ah, no. I’m not. sorry. my mistake
ok, plan is to ship 0.1.0 tomorrow. going to clean up some internals and polish some docs, but anything relevant missing? the GraalVM tests? https://github.com/metosin/malli/pull/272
also, removing :list
as it’s not very useful, right?
I haven’t used it fwiw