Skip to content

Commit 57b7faa

Browse files
authored
Add kwargs to to_json (#365)
1 parent bd1438c commit 57b7faa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/json_util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@ def default(self, o):
5252
return json.JSONEncoder.default(self, o)
5353

5454

55-
def to_json(obj):
56-
return json.dumps(obj, cls=Encoder, indent=2, ignore_nan=True)
55+
def to_json(obj, **kwargs):
56+
indent = kwargs.pop("indent", 2)
57+
return json.dumps(obj, cls=Encoder, indent=indent, ignore_nan=True, **kwargs)

0 commit comments

Comments
 (0)