Hi! It’s normal that typedclojure don’t throw error in this code:
(def Pokemon
[:map
[:pokemon/name :string]
[:pokemon/level :int]])
(m/=> display-pokemon [:=> [:cat Pokemon] :string])
(defn display-pokemon [pokemon]
(format "%s is at level %s" (:foo pokemon) (:baz pokemon)))
foo and baz are not in the pokemon definition. I don’t know if it’s possible to do this kind of check.So the malli schema there is "open" - meaning you are allowed to have keys that are not in there
and even if you made it closed, you would then just know that the lookup would give nil
Even if the map is closed, there is no error.
Yes this is normal. (:foo pokemon) should be inferred as nil.