renderers.py 248 B

12345678910
  1. import orjson
  2. from ninja import NinjaAPI
  3. from ninja.renderers import BaseRenderer
  4. class ORJSONRenderer(BaseRenderer):
  5. media_type = "application/json"
  6. def render(self, request, data, *, response_status):
  7. return orjson.dumps(data)