Skip to content
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

User-defined formatter validate functions have to handle None. #132

Open
dpopowich opened this issue Nov 30, 2016 · 1 comment
Open

User-defined formatter validate functions have to handle None. #132

dpopowich opened this issue Nov 30, 2016 · 1 comment

Comments

@dpopowich
Copy link

When defining custom formatters with SwaggerFormat, the validate function has to handle None values. So all my validators are littered with code like this:

def my_validator(val):
   if val is not None:
      # real validation here

Shouldn't None be special-cased, left to x-nullable checking, never calling the validator when value==None is True? This is quite tedious.

@adamhadani
Copy link
Contributor

+1
Might be related to my PR #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants