Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

TypeError: Expected a 'coreapi.Document' instance #823

Open
dengsibao opened this issue Mar 13, 2020 · 0 comments
Open

TypeError: Expected a 'coreapi.Document' instance #823

dengsibao opened this issue Mar 13, 2020 · 0 comments

Comments

@dengsibao
Copy link

my env:
python 3.6
django 3.0.4
django-rest-swagger 2.2.0
djangorestframework 3.11.0

error:
Internal Server Error: /docs/ Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py", line 145, in _get_response response = self.process_exception_by_middleware(e, request) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py", line 143, in _get_response response = response.render() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/template/response.py", line 106, in render self.content = self.rendered_content File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rest_framework/response.py", line 70, in rendered_content ret = renderer.render(self.data, accepted_media_type, context) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rest_framework_swagger/renderers.py", line 54, in render self.set_context(data, renderer_context) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rest_framework_swagger/renderers.py", line 70, in set_context renderer_context=renderer_context File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rest_framework_swagger/renderers.py", line 34, in render return OpenAPICodec().encode(data, **options) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rest_framework_swagger/renderers.py", line 16, in encode raise TypeError('Expected a coreapi.Documentinstance') TypeError: Expected acoreapi.Documentinstance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant