-
Notifications
You must be signed in to change notification settings - Fork 215
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
More friendly explanation for :malli.core/invalid-type
#750
Comments
I think the error should be improved here. To get a schema type for the value, we would have to run inferring on it. This would make the Some options here:
(me/humanize
(m/explain [:sequential :string] #{"a"})
{:errors {::m/invalid-type {:error/fn malli.provider/what-you-asked}}}) |
Thank you!
This SGTM if that means a nice default for everyone 👍 (FYI I don't have the capacity these days to create many PRs)
I respect this constraint, however one can see that there are at least two types of use cases:
It would seem wise to not couple the performance characteristics of both use cases. Perhaps a separate ns e.g. |
Newbie (we just started using |
Additional data point - I also see this behavior almost daily while developing Reitit apps and it can be fairly frustrating at times! |
Hi @ikitommi, that confused me even more. |
@neuhalje please loook |
Hi!
The following:
returns
"invalid-type"
. That could be improved in a couple ways:expected :sequential, got :set
there was a type mismatch for this value
"invalid type"
, it actually would make it evident that the value is wrong, not the schema itself (which is what I mistakenly believed while debugging this).wdyt?
Thanks - V
The text was updated successfully, but these errors were encountered: