Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging registries produces child-error #780

Open
bartkl opened this issue Nov 16, 2022 · 0 comments
Open

Merging registries produces child-error #780

bartkl opened this issue Nov 16, 2022 · 0 comments
Labels
documentation Documentation improvement enhancement New feature or request

Comments

@bartkl
Copy link

bartkl commented Nov 16, 2022

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, just Schemas. 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…}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation improvement enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants