diff --git a/orbiter/file_types.py b/orbiter/file_types.py index efe4098..bb9543c 100644 --- a/orbiter/file_types.py +++ b/orbiter/file_types.py @@ -36,7 +36,9 @@ def ext_validate(cls, v: Set[str]): class FileTypeJSON(FileType): extension: ClassVar[Set[str]] = {"JSON"} load_fn: ClassVar[Callable[[str], dict]] = json.loads - dump_fn: ClassVar[Callable[[dict], str]] = xmltodict.unparse + dump_fn: ClassVar[Callable[[dict], str]] = partial( + json.dumps, default=str, indent=2 + ) # noinspection t @@ -106,9 +108,7 @@ def _fix(d): class FileTypeXML(FileType): extension: ClassVar[Set[str]] = {"XML"} load_fn: ClassVar[Callable[[str], dict]] = xmltodict_parse - dump_fn: ClassVar[Callable[[dict], str]] = partial( - json.dumps, default=str, indent=2 - ) + dump_fn: ClassVar[Callable[[dict], str]] = xmltodict.unparse class FileTypeYAML(FileType):