-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
:reason doesn't compose as expected #171
Comments
:reason
doesn't compose as expected
I would expect that too. |
In the (s/def ::spec-with-reason (st/spec {:reason "missingKey" :spec (s/keys :req-un [::k1 ::k2])}))
(st/explain ::spec-with-reason {:k2 "2" :k1 1})
;; => 1 - failed: missingKey in: [:k1] at: [:k1] spec: :spec-tools.core/k1 Let me know if I am missing something here. |
@wandersoncferreira The :reason is set to "missingKey", while it should be "k1". This is still the case with your fix to the spec, but the location of the error is correct here. The wanted result is: |
Fixes nested reasons being overwritten by outer spec's reason #171.
Please correct me if I'm wrong. I have the following:
Shouldn't validation of
spec-with-reason
fail with"k1"
instead?The text was updated successfully, but these errors were encountered: