tomchristie/django-rest-framework — Issue #122: Infinite recursion if you only have a Documenting renderer
Author: remcogerlich
Created: 2012-01-11 08:10:54+00:00
State: open

If you only have a documenting renderer and no other renderers, or if the Documenting renderer is the first in the list of renderers, it keeps calling itself. That is because the check for this in renderers.py (line 218) is wrong:

# Find the first valid renderer and render the content. (Don't use another documenting renderer.)
renderers = [renderer for renderer in view.renderers if not isinstance(renderer, DocumentingTemplateRenderer)]
if not renderers:
return '[No renderers were found]'

Renderers are _classes_, so the isinstance() check is always False. It should be issubclass() instead.