metosin / malli

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

Strip-extra-keys should not break on non-map values #818

Closed Deraen closed 1 year ago

Deraen commented 1 year ago

strip-extra-keys-transformer is used for transforming map schemas, but it doesn't check the value being transformed and reduce-kv will fail if given e.g. a string as a value.

Non-map values (like strings) are a valid case for :map schema transforming, as they can be decoded into maps. Reitit however has strip-extra-keys transformer before string-decoding, so strip-extra-keys always sees the string value. But I think transformers shouldn't fail like this in any case.