Skip to content

Commit afc8dba

Browse files
committed
set default when validate None
1 parent 47b8dfe commit afc8dba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

swagger_py_codegen/templates/flask/validators.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def request_validate(view):
9191
locations = validators.get((endpoint, method), {})
9292
for location, schema in six.iteritems(locations):
9393
value = getattr(request, location, MultiDict())
94+
if value is None:
95+
value = MultiDict()
9496
validator = FlaskValidatorAdaptor(schema)
9597
result, errors = validator.validate(value)
9698
if errors:

0 commit comments

Comments
 (0)