diff --git a/posthog/renderers.py b/posthog/renderers.py index a733c4f17b5aa..fa2d532fdce70 100644 --- a/posthog/renderers.py +++ b/posthog/renderers.py @@ -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)