Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested map with invalid value breaks strip-extra-keys-transformer when using map-of #1118

Open
bgalartza opened this issue Nov 11, 2024 · 1 comment

Comments

@bgalartza
Copy link
Contributor

bgalartza commented Nov 11, 2024

Apparently having a nested map with an invalid value inside map-of breaks the strip-extra-keys-transformer.

Works as expected:

(m/encode
 [:map-of
  :any
  [:map
   [:a
    [:string]]
   [:b
    [:string]]]]
 {"anything" {:a "a" :b "b" :c "c"}}
 mt/strip-extra-keys-transformer)
{"anything" {:a "a", :b "b"}

Produces empty map instead of {"anything" {:a "a"}}:

(m/encode
 [:map-of
  :any
  [:map
   [:a
    [:string]]
   [:b
    [:string]]]]
 {"anything" {:a "a" :c "c"}}
 mt/strip-extra-keys-transformer)
 {}

I found some mention to this problem in this pull request

@bgalartza bgalartza changed the title Invalid value breaks strip-extra-keys-transformer when using map-of Nested map with invalid value breaks strip-extra-keys-transformer when using map-of Nov 11, 2024
@opqdonut
Copy link
Member

might be related to #1112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants