Skip to content

Commit

Permalink
Restore browsable API JSON indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie committed Feb 21, 2024
1 parent d55e601 commit 83aa786
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion posthog/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ def render(self, data, accepted_media_type=None, renderer_context=None) -> bytes
if data is None:
return b""

return orjson.dumps(data, default=JSONEncoder().default, option=orjson.OPT_UTC_Z)
option = orjson.OPT_UTC_Z

if renderer_context and renderer_context.get("indent"):
option |= orjson.OPT_INDENT_2

return orjson.dumps(data, default=JSONEncoder().default, option=option)

0 comments on commit 83aa786

Please sign in to comment.