metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.44k stars 204 forks source link

fix path->in with :orn, :catn and :altn #969

Closed ikitommi closed 8 months ago

ikitommi commented 8 months ago

this is wrong:

(require '[malli.core :as m ]) 
  (def my-schema
    (m/schema [:orn
               [:a-branch [:map [:a :int]]]
               [:b-branch [:map [:b :int]]]]))   

  (let [{:keys [errors schema]} (m/explain my-schema {:a "2"})]
    (mu/path->in schema (:path (first errors))))
;;=>
[:a-branch :a]

PR fixes it.