Add -walk option to inherit ::val properties#1091
Draft
frenchy64 wants to merge 3 commits intometosin:masterfrom
Draft
Add -walk option to inherit ::val properties#1091frenchy64 wants to merge 3 commits intometosin:masterfrom
-walk option to inherit ::val properties#1091frenchy64 wants to merge 3 commits intometosin:masterfrom
Conversation
Member
|
Had to revisit how the entry walking works, this is not good: (defn walk [schema]
(m/walk
schema
(m/schema-walker identity)
{::m/walk-entry-vals true}))
(-> [:map [:x :int]] (walk) (walk) (walk))
; [:map [:x [:malli.core/val [:malli.core/val [:malli.core/val :int]]]]]I guess the right thing to do would be to do automatically the opposite unwrapping somewhere. Where? in the |
Collaborator
Author
Yes, I noticed the same thing.
I think it would reasonable for |
Member
I think it's a bug that the entries are kept after walking, so it would be ok to to de-walk them using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: during a
-walk, it's useful for the props of::valnodes to be inherited by the:map/:or/:multientry. Currently this is difficult to implement.This simplifies
walk-propertiesin the documentation, but I'm not sure it's airtight enough to release as more than a suggestion.I considered reusing
::walk-entry-valsbut it could be a breaking change.