From a9d9dce811f1370d71e900ce6f8a5a61c881d533 Mon Sep 17 00:00:00 2001 From: pesap Date: Wed, 22 Jan 2025 16:41:06 -0700 Subject: [PATCH] feat: Add `round_trip=True` as a default json serialization. --- src/infrasys/serialization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrasys/serialization.py b/src/infrasys/serialization.py index 4bf2c7e..541454b 100644 --- a/src/infrasys/serialization.py +++ b/src/infrasys/serialization.py @@ -88,7 +88,7 @@ def get_type(self, metadata: SerializedTypeBase) -> Type: def serialize_value(obj: InfraSysBaseModel, *args, **kwargs) -> dict[str, Any]: """Serialize an infrasys object to a dictionary.""" cls = type(obj) - data = obj.model_dump(*args, mode="json", **kwargs) + data = obj.model_dump(*args, mode="json", round_trip=True, **kwargs) data[TYPE_METADATA] = SerializedTypeMetadata( fields=SerializedBaseType( module=cls.__module__,