-
Notifications
You must be signed in to change notification settings - Fork 240
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
Documentation example has wrong number of arguments in validation method #456
Comments
had you confused custom validators with type checks? because the example you show is about a deprecated form of type checks, while you link the section about custom validators. |
@funkyfuture OK I see that in ce1ef4f you removed the kind of type check that I am currently using. However, I'm not sure how to implement it using the more restrictive type checking you have now. The |
certainly, different approaches are possible with Cerberus (a custom rule or shall we leave this issue open regarding an improvement of the docs? the briefly discussed paradigm isn't covered there yet and i recently noticed that it could use some polishing (reviewing @nir0s claim that the docs on customization were execellent, thank you for the 🌷) |
Thanks, yes, a good working example would be helpful, essentially showing how you would replace the lost deprecated custom types functionality. No rush, but sometime before the release that removes custom types would be great! |
i'd rather describe it as the "possibility to over-use the type-role which was propagated for too long". i'm noting this as i'd prefer examples that focus on good practices rather than on a deficitary view on "losses". while the latter is good to unlearn things, i'd say it's additional, confusing information for new users in the long term. of course we can still amend the |
In cerberus 1.2, the example for http://docs.python-cerberus.org/en/stable/customize.html#custom-validators seems to have the wrong number of arguments. I was only able to get this to work with 2 arguments (including
self
), not 3. For example:Note that
def _validate_type_seconds(self, value)
has onlyself
andvalue
, whereas the documentation example hasself
,field
, andvalue
.The text was updated successfully, but these errors were encountered: