You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
render method on the main renderer is defined like this: def render(self, data, media_type=None, renderer_context={}, writer_opts=None):here which is both not how other renderers are defined and has a mutable object as a default value which is discouraged and could be dangerous.
I suggest we update it to something closer to other examples in DRF: def render(self, data, accepted_media_type=None, renderer_context=None). I'll prepare a PR if there are no volunteers or objections.
The text was updated successfully, but these errors were encountered:
While at it, streaming renderer's result is not displayed correctly in browsable api. Instead something like this is shown: <generator object CSVStreamingRenderer.render at 0x7f773d04ff10> perhaps some more sophisticated object can be used there, something that can be rendered into django template if needed but otherwise behaving like a generator?
render
method on the main renderer is defined like this:def render(self, data, media_type=None, renderer_context={}, writer_opts=None):
here which is both not how other renderers are defined and has a mutable object as a default value which is discouraged and could be dangerous.I suggest we update it to something closer to other examples in DRF:
def render(self, data, accepted_media_type=None, renderer_context=None)
. I'll prepare a PR if there are no volunteers or objections.The text was updated successfully, but these errors were encountered: