-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
For some reason zen tries to valiadate properties on all data coming in, this can be illustrated on a map:
I expect to get error that :zen/tags is not a valid key defined for my map, but I get no errors instead. After I can pass a hash set of symbols it is apparent that it is being validated by the 'zen/tags schema.
(def ztx (zen.core/new-context {}))
(zen.core/load-ns ztx '{:ns myns foo {:zen/tags #{zen/schema}
:type zen/map
:keys {:foo {:type zen/string}}}})
(zen.core/validate ztx #{'myns/foo} {:zen/tags "foo"})
;; => {:errors [], :warnings [], :effects []}
(zen.core/validate ztx #{'myns/foo} {:zen/tags #{'myns/foo}})
;; => {:errors
;; [{:message
;; "Expected symbol 'myns/foo tagged with '#{zen/tag}, but only #{zen/schema}",
;; :type "symbol",
;; :path [:zen/tags myns/foo],
;; :schema [myns/foo :property :zen/tags :every myns/foo :tags]}],
;; :warnings [],
;; :effects []}
Metadata
Metadata
Assignees
Labels
No labels