From 504e8c9d170f4acf6b8aee66e5df556eb5e47e7e Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Thu, 30 Apr 2020 18:26:11 +0200 Subject: [PATCH] Fixed json encoder for objects not using pydantic --- jeeves/core/parsers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jeeves/core/parsers.py b/jeeves/core/parsers.py index ed383bf..453c783 100644 --- a/jeeves/core/parsers.py +++ b/jeeves/core/parsers.py @@ -1,4 +1,3 @@ -import json from typing import Any, Text, MutableMapping from pathlib import Path @@ -33,7 +32,7 @@ class ObjectParser: @classmethod def to_json(cls, obj: BaseObject) -> Text: - return json.dumps(cls.to_dict(obj)) + return obj.json() @classmethod def from_toml(cls, serialized: Text) -> BaseObject: