@@ -464,13 +464,19 @@ impl AdditionalPropertiesWithNullable {
464464
465465// Utility function for wrapping list elements when serializing xml
466466#[ allow( non_snake_case) ]
467- fn wrap_in_snake_another_xml_inner < S > ( item : & Vec < String > , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
467+ fn wrap_in_snake_another_xml_inner < S > ( items : & Vec < String > , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
468468where
469469 S : serde:: ser:: Serializer ,
470470{
471- serde_xml_rs:: wrap_primitives ( item, serializer, "snake_another_xml_inner" )
472- }
471+ use serde:: ser:: SerializeMap ;
473472
473+ let mut map = serializer. serialize_map ( None ) ?;
474+ for ref item in items {
475+ map. serialize_key ( "snake_another_xml_inner" ) ?;
476+ map. serialize_value ( item) ?;
477+ }
478+ map. end ( )
479+ }
474480#[ derive( Debug , Clone , PartialEq , serde:: Serialize , serde:: Deserialize ) ]
475481#[ cfg_attr( feature = "conversion" , derive( frunk:: LabelledGeneric ) ) ]
476482pub struct AnotherXmlArray (
@@ -953,10 +959,10 @@ impl AnotherXmlObject {
953959 /// Will panic if serialisation fails.
954960 #[ allow( dead_code) ]
955961 pub ( crate ) fn as_xml ( & self ) -> String {
956- let mut namespaces = std:: collections:: BTreeMap :: new ( ) ;
957962 // An empty string is used to indicate a global namespace in xmltree.
958- namespaces. insert ( "" . to_string ( ) , Self :: NAMESPACE . to_string ( ) ) ;
959- serde_xml_rs:: to_string_with_namespaces ( & self , namespaces) . expect ( "impossible to fail to serialize" )
963+ let config = serde_xml_rs:: SerdeXml :: new ( )
964+ . namespace ( "" , Self :: NAMESPACE ) ;
965+ config. to_string ( & self ) . expect ( "impossible to fail to serialize" )
960966 }
961967}
962968
@@ -1854,10 +1860,10 @@ impl DuplicateXmlObject {
18541860 /// Will panic if serialisation fails.
18551861 #[ allow( dead_code) ]
18561862 pub ( crate ) fn as_xml ( & self ) -> String {
1857- let mut namespaces = std:: collections:: BTreeMap :: new ( ) ;
18581863 // An empty string is used to indicate a global namespace in xmltree.
1859- namespaces. insert ( "" . to_string ( ) , Self :: NAMESPACE . to_string ( ) ) ;
1860- serde_xml_rs:: to_string_with_namespaces ( & self , namespaces) . expect ( "impossible to fail to serialize" )
1864+ let config = serde_xml_rs:: SerdeXml :: new ( )
1865+ . namespace ( "" , Self :: NAMESPACE ) ;
1866+ config. to_string ( & self ) . expect ( "impossible to fail to serialize" )
18611867 }
18621868}
18631869
@@ -5191,13 +5197,19 @@ impl UuidObject {
51915197
51925198// Utility function for wrapping list elements when serializing xml
51935199#[ allow( non_snake_case) ]
5194- fn wrap_in_camelXmlInner < S > ( item : & Vec < String > , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
5200+ fn wrap_in_camelXmlInner < S > ( items : & Vec < String > , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
51955201where
51965202 S : serde:: ser:: Serializer ,
51975203{
5198- serde_xml_rs:: wrap_primitives ( item, serializer, "camelXmlInner" )
5199- }
5204+ use serde:: ser:: SerializeMap ;
52005205
5206+ let mut map = serializer. serialize_map ( None ) ?;
5207+ for ref item in items {
5208+ map. serialize_key ( "camelXmlInner" ) ?;
5209+ map. serialize_value ( item) ?;
5210+ }
5211+ map. end ( )
5212+ }
52015213#[ derive( Debug , Clone , PartialEq , serde:: Serialize , serde:: Deserialize ) ]
52025214#[ cfg_attr( feature = "conversion" , derive( frunk:: LabelledGeneric ) ) ]
52035215pub struct XmlArray (
@@ -5695,9 +5707,9 @@ impl XmlObject {
56955707 /// Will panic if serialisation fails.
56965708 #[ allow( dead_code) ]
56975709 pub ( crate ) fn as_xml ( & self ) -> String {
5698- let mut namespaces = std:: collections:: BTreeMap :: new ( ) ;
56995710 // An empty string is used to indicate a global namespace in xmltree.
5700- namespaces. insert ( "" . to_string ( ) , Self :: NAMESPACE . to_string ( ) ) ;
5701- serde_xml_rs:: to_string_with_namespaces ( & self , namespaces) . expect ( "impossible to fail to serialize" )
5711+ let config = serde_xml_rs:: SerdeXml :: new ( )
5712+ . namespace ( "" , Self :: NAMESPACE ) ;
5713+ config. to_string ( & self ) . expect ( "impossible to fail to serialize" )
57025714 }
57035715}
0 commit comments