The ensure-matching
solution above worked for us, thanks.
We also found the need for another defdynamicnav, I'm posting it here in case anyone finds it helpful:
(specter/defdynamicnav look-ahead [path]
(specter/if-path path specter/STAY (specter/terminal-val specter/NONE)))
It is used like this:
(transform [ALL (schema-check/look-ahead (must :a))] str [{:a 1 :b 1} {:x 2 :b 2}])
evaluates to => ["{:a 1, :b 1}"]
Another example:
(transform [ALL (schema-check/look-ahead (must :a)) :b] str [{:a 1 :b 1} {:x 2 :b 2}])
=> [{:a 1, :b "1"}]
@rafael cool
I opened an issue to add functionality like this into Specter https://github.com/nathanmarz/specter/issues/240