Open
Description
As asked on the Slack channel, I was wondering if it is expected behavior to get an error when explicitly stating to use the default schemas registry:
(m/validate
[:map
[:x string?]]
{:a 1}) ;; => false
(m/validate
[:map {:registry (merge (m/default-schemas))}
[:x string?]]
{:a 1})
;; => clojure.lang.ExceptionInfo: :malli.core/child-error {:type :enum, :properties nil, :children nil, :min 1, :max nil}
;; {:type :malli.core/child-error, :message :malli.core/child-error, :data {:type :enum, :properties nil, :children nil, :min 1, :max nil}}
@ikitommi already pointed out that:
currently, the property-registry doesn’t allow
IntoSchema
instances, justSchema
s. Original idea was that you can only present serializable things. Not sure if this is a good constraint, as you can anyway have non-serializable things in schemas, e.g[:string {:gen/gen …generator-function-here…}]