This commit is contained in:
Sérgio Basto 2017-08-21 16:06:54 +00:00 committed by GitHub
commit 07ffec7fd0

View File

@ -99,6 +99,13 @@ class JSONRenderer(BaseRenderer):
else:
separators = INDENT_SEPARATORS
if type(data) is dict:
ret = json.dumps(
data, cls=self.encoder_class,
indent=indent, ensure_ascii=self.ensure_ascii,
separators=separators, sort_keys=True
)
else:
ret = json.dumps(
data, cls=self.encoder_class,
indent=indent, ensure_ascii=self.ensure_ascii,