Skip to content

Commit

Permalink
config: json renderer uses indent=2 and sort_keys
Browse files Browse the repository at this point in the history
sorting the keys makes the output a lot more consistent and easier to read

there seems to be little to no performance impact
  • Loading branch information
robvdl committed Mar 12, 2024
1 parent 1e15508 commit b195d64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sambal/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def includeme(config):
"""Configure the builtin json renderer to handle more data types."""
json_renderer = JSON()
json_renderer = JSON(indent=2, sort_keys=True)
json_renderer.add_adapter(datetime, datetime_adapter)
json_renderer.add_adapter(Decimal, decimal_adapter)
json_renderer.add_adapter(Dn, dn_adapter)
Expand Down

0 comments on commit b195d64

Please sign in to comment.