Update openapi.py

This commit is contained in:
Tom Christie 2020-01-03 13:50:26 +00:00 committed by GitHub
parent ced37a56cb
commit 430a567258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,7 +393,7 @@ class AutoSchema(ViewInspector):
schema['writeOnly'] = True schema['writeOnly'] = True
if field.allow_null: if field.allow_null:
schema['nullable'] = True schema['nullable'] = True
if field.default and field.default != empty and not callable(field.default): # why don't they use None?! if field.default and field.default != empty and not callable(field.default):
schema['default'] = field.default schema['default'] = field.default
if field.help_text: if field.help_text:
schema['description'] = str(field.help_text) schema['description'] = str(field.help_text)