-
Notifications
You must be signed in to change notification settings - Fork 238
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
Rename and Coerce do not work together #607
Comments
yes, it is a known issue that people walk into by intuition. be aware that validation rules are validated against the normalized document. i keep this issue open as a reminder that admonitions that point people to the proper considerations should be added to the docs about schemas and normalization rules. also, the former should be renamed to just "Schemas". other documents and docstrings also still state "validation schemas" (sometimes joined w/ a dash) though they are meant generally. |
also rename and default don't work together >>>from cerberus import Validator
>>>v = Validator({'foo': {'default': '1', 'rename': 'bar'}})
>>>print(v.normalized({'foo': 2}))
{'bar': 2, 'foo': '1'}
#expect result
{'bar': 2} i think rename should process at last in function __normalize_mapping |
I would expect the coerce to still take effect here. Please let me know whether this is intended behavior or if there is another way to do what I intended.
The text was updated successfully, but these errors were encountered: