From 863e0e4b9f61aee0fca2c1b56fefc281e8d816f8 Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Thu, 28 May 2020 09:17:49 -0400 Subject: [PATCH] Handle None case --- rest_framework/schemas/openapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index be2e2579e..8da744801 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -286,7 +286,8 @@ class AutoSchema(ViewInspector): description = get_pk_description(model, model_field) if model_field is None and isinstance(model.__dict__[variable], property): - description = getdoc(model.__dict__[variable]) + doc = getdoc(model.__dict__[variable]) + description = '' if doc is None else doc parameter = { "name": variable,