API: improve json serialization

This commit is contained in:
Johannes Kirschbauer
2024-07-10 16:56:37 +02:00
parent 4c4f55f309
commit 3c86f0a327

View File

@@ -21,7 +21,7 @@ log = logging.getLogger(__name__)
def sanitize_string(s: str) -> str:
return s.replace("\\", "\\\\").replace('"', '\\"')
return s.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n")
def dataclass_to_dict(obj: Any) -> Any: