From 38f42d64e556a85206faa50459a9ce3e889bd3ae Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Wed, 29 Nov 2023 17:34:32 +0100 Subject: [PATCH] feat: more controll over XML attribute serialization (#34) Signed-off-by: Jan Kowalleck --- serializable/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serializable/__init__.py b/serializable/__init__.py index 4b7bd10..4fe1b9b 100644 --- a/serializable/__init__.py +++ b/serializable/__init__.py @@ -372,7 +372,8 @@ def as_xml(self: Any, view_: Optional[Type[ViewType]] = None, new_key = CurrentFormatter.formatter.encode(property_name=new_key) if prop_info.custom_type and prop_info.is_helper_type(): - v = prop_info.custom_type.xml_serialize(v) + v = prop_info.custom_type.xml_normalize( + v, view=view_, element_name=new_key, xmlns=xmlns, prop_info=prop_info, ctx=self.__class__) elif prop_info.is_enum: v = v.value