Skip to content

Commit

Permalink
schema-walker uses options from schema, not from walking
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Jul 13, 2020
1 parent 47369ec commit 9f105a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/malli/core.cljc
Expand Up @@ -1056,8 +1056,8 @@
;;

(defn schema-walker [f]
(fn [schema children _ options]
(f (into-schema (type schema) (properties schema) children options))))
(fn [schema children _ _]
(f (into-schema (-type schema) (-properties schema) children (-options schema)))))

(defn ^:no-doc map-syntax-walker [schema children _ _]
(let [properties (properties schema)]
Expand Down
5 changes: 4 additions & 1 deletion test/malli/core_test.cljc
Expand Up @@ -71,7 +71,10 @@

(deftest schema-walker-test
(is (form= [:map {:closed true} [:x int?]]
(m/walk [:map {:closed true} [:x int?]] (m/schema-walker identity)))))
(m/walk [:map {:closed true} [:x int?]] (m/schema-walker identity))))
(is (form= [:map {:registry {::age [:and int? [:> 18]]}} [:age ::age]]
(m/walk [:map {:registry {::age [:and int? [:> 18]]}} [:age ::age]]
(m/schema-walker identity)))))

(deftest validation-test

Expand Down

0 comments on commit 9f105a5

Please sign in to comment.