diff --git a/pykson/__init__.py b/pykson/__init__.py index 6df16e9..79e7426 100644 --- a/pykson/__init__.py +++ b/pykson/__init__.py @@ -725,6 +725,8 @@ def __init__(self, accept_unknown: bool = False, extra_attributes: Optional[List # Empty init will be replaced by meta class super(JsonObject, self).__init__() + def __str__(self): + return json.dumps(json.loads(Pykson().to_json(self)), indent=2, sort_keys=True) T = TypeVar('T', bound=JsonObject)