-
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
Wrong keys exception can point at the wrong (wrong) keys #80
Comments
I'm not sure this is entirely wrong. For example, you may want to specify case-insensitive keys, so that any capitalization of |
Using your schema doesn't really change much in this problem:
|
The idea is that you'd use the final key, |
I'm afraid I don't quite understand what your proposed solution is. |
Oh, I see what you mean now. I was thinking of the way we validate the values, not the keys. I'll have a look at this in more detail later and get back to you. |
So, I guess the downside to #80 is that we have additional runtime costs to build Does anyone see a way of moving the computation to the point where we already know that we're going to have an exception? |
With the current
master
:The problem is that the error message claims that
'Id'
is a wrong key although'Id'
has been validated. The only key that hasn't been validated in this example is'Name'
.This is due to
'Id'
's schema,And(str, Use(str.lower), 'id')
, which transforms'Id'
to'id'
which results in'Id'
being included inwrong_keys
.In general, this incorrect error message can always appear if key schemas transform their data.
Any ideas how to fix this? Is there a way to compute
wrong_keys
that is both simple and precise?The text was updated successfully, but these errors were encountered: