Added sort_keys=True by default in JSON serializer.

This commit is contained in:
Fabio Caccamo 2020-12-22 12:49:58 +01:00
parent b7066e1812
commit cd18c854e8
1 changed files with 1 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class JSONSerializer(AbstractSerializer):
def encode(self, d, **kwargs):
kwargs.setdefault('default', self._encode_default)
kwargs.setdefault('sort_keys', True)
data = json.dumps(d, **kwargs)
return data