handle default=false for boolean fields

This commit is contained in:
Stella Margonar 2020-01-28 15:20:17 +01:00
parent d21b8eb084
commit 70b5d6c5b8

View File

@ -378,7 +378,7 @@ class AutoSchema(ViewInspector):
schema['writeOnly'] = True
if field.allow_null:
schema['nullable'] = True
if field.default and field.default != empty and not callable(field.default):
if field.default is not None and field.default != empty and not callable(field.default):
schema['default'] = field.default
if field.help_text:
schema['description'] = str(field.help_text)