django rest框架get#u schema_视图:TypeError:类型为'的对象;文件';JSON不可序列化

django rest框架get#u schema_视图:TypeError:类型为'的对象;文件';JSON不可序列化,django,django-rest-framework,openapi,Django,Django Rest Framework,Openapi,django rest framework版本3.9中的包现在默认以yaml格式呈现api模式视图 当我尝试以JSON格式呈现它时,如示例所示 我得到: TypeError: Object of type 'Document' is not JSON serializable 软件包版本:Django==2.2.12,djangorestframework==3.11.0,openapi编解码器==1.3.2 任何帮助都将不胜感激。我最终使用CoreJSONRenderer获得了我想要的。我最

django rest framework
版本3.9中的包现在默认以yaml格式呈现api模式视图

当我尝试以JSON格式呈现它时,如示例所示

我得到:

TypeError: Object of type 'Document' is not JSON serializable
软件包版本:
Django==2.2.12
djangorestframework==3.11.0
openapi编解码器==1.3.2


任何帮助都将不胜感激。

我最终使用
CoreJSONRenderer
获得了我想要的。

我最终使用
CoreJSONRenderer
获得了我想要的

TypeError: Object of type 'Document' is not JSON serializable