diff --git a/wsdl-parser/tests/port_type_to_function/expected.rs b/wsdl-parser/tests/port_type_to_function/expected.rs index 7b857c33..41a9bf90 100644 --- a/wsdl-parser/tests/port_type_to_function/expected.rs +++ b/wsdl-parser/tests/port_type_to_function/expected.rs @@ -1,5 +1,5 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")] pub struct GetServices { // Indicates if the service capabilities (untyped) should be included in the @@ -11,7 +11,7 @@ pub struct GetServices { impl Validate for GetServices {} -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")] pub struct GetServicesResponse { // Each Service element contains information about one service. diff --git a/xsd-parser/src/generator/enum.rs b/xsd-parser/src/generator/enum.rs index d314e72d..449d1b7e 100644 --- a/xsd-parser/src/generator/enum.rs +++ b/xsd-parser/src/generator/enum.rs @@ -65,7 +65,7 @@ pub trait EnumGenerator { return "#[derive(PartialEq, Debug, UtilsUnionSerDe)]".into(); } - let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]"; + let derives = "#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]"; let tns = gen.target_ns.borrow(); match tns.as_ref() { Some(tn) => match tn.name() { diff --git a/xsd-parser/tests/all/expected.rs b/xsd-parser/tests/all/expected.rs index 4534a17a..97064988 100644 --- a/xsd-parser/tests/all/expected.rs +++ b/xsd-parser/tests/all/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "Once")] diff --git a/xsd-parser/tests/any/expected.rs b/xsd-parser/tests/any/expected.rs index f568b7ff..62e249a9 100644 --- a/xsd-parser/tests/any/expected.rs +++ b/xsd-parser/tests/any/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "Name")] diff --git a/xsd-parser/tests/choice/expected.rs b/xsd-parser/tests/choice/expected.rs index 325a8d7f..4d35757f 100644 --- a/xsd-parser/tests/choice/expected.rs +++ b/xsd-parser/tests/choice/expected.rs @@ -1,10 +1,10 @@ -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct BarType(pub String); -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct BazType(pub i32); -#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub enum FooTypeChoice { Bar(BarType), @@ -18,7 +18,7 @@ impl Default for FooTypeChoice { } } -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(flatten)] diff --git a/xsd-parser/tests/complex_type/expected.rs b/xsd-parser/tests/complex_type/expected.rs index 137a06ad..887808fc 100644 --- a/xsd-parser/tests/complex_type/expected.rs +++ b/xsd-parser/tests/complex_type/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "Min")] diff --git a/xsd-parser/tests/complex_type_subtypes_clash/expected.rs b/xsd-parser/tests/complex_type_subtypes_clash/expected.rs index 1dfd0e25..5cacde00 100644 --- a/xsd-parser/tests/complex_type_subtypes_clash/expected.rs +++ b/xsd-parser/tests/complex_type_subtypes_clash/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "Extension")] @@ -10,14 +10,14 @@ impl Validate for FooType {} pub mod foo_type { use super::*; - #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] + #[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct ExtensionType {} impl Validate for ExtensionType {} } -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct BarType { #[yaserde(prefix = "tns", rename = "Extension")] @@ -29,7 +29,7 @@ impl Validate for BarType {} pub mod bar_type { use super::*; - #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] + #[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct ExtensionType {} diff --git a/xsd-parser/tests/enumeration/expected.rs b/xsd-parser/tests/enumeration/expected.rs index c74af0e3..e27fb074 100644 --- a/xsd-parser/tests/enumeration/expected.rs +++ b/xsd-parser/tests/enumeration/expected.rs @@ -1,4 +1,4 @@ -#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub enum FooType { #[yaserde(rename = "OFF")] @@ -18,7 +18,7 @@ impl Default for FooType { impl Validate for FooType {} -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct FooType2(pub String); impl Validate for FooType2 {} diff --git a/xsd-parser/tests/extension_base/expected.rs b/xsd-parser/tests/extension_base/expected.rs index 8849a9dd..41068414 100644 --- a/xsd-parser/tests/extension_base/expected.rs +++ b/xsd-parser/tests/extension_base/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct BarType { #[yaserde(prefix = "tns", rename = "b")] @@ -10,7 +10,7 @@ pub struct BarType { impl Validate for BarType {} -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "a")] diff --git a/xsd-parser/tests/extension_base_multilayer/expected.rs b/xsd-parser/tests/extension_base_multilayer/expected.rs index 2bed61c9..b6c13ea6 100644 --- a/xsd-parser/tests/extension_base_multilayer/expected.rs +++ b/xsd-parser/tests/extension_base_multilayer/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct BarType { #[yaserde(prefix = "tns", rename = "aa")] @@ -10,7 +10,7 @@ pub struct BarType { impl Validate for BarType {} -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "Messages")] @@ -22,7 +22,7 @@ impl Validate for FooType {} pub mod foo_type { use super::*; - #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] + #[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct MessagesType { #[yaserde(prefix = "tns", rename = "a")] diff --git a/xsd-parser/tests/extension_base_two_files/expected.rs b/xsd-parser/tests/extension_base_two_files/expected.rs index d6e658a2..800605bc 100644 --- a/xsd-parser/tests/extension_base_two_files/expected.rs +++ b/xsd-parser/tests/extension_base_two_files/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde( prefix = "tns", namespace = "tns: http://example.com", diff --git a/xsd-parser/tests/ref_to_attribute/expected.rs b/xsd-parser/tests/ref_to_attribute/expected.rs index 1093a598..76325321 100644 --- a/xsd-parser/tests/ref_to_attribute/expected.rs +++ b/xsd-parser/tests/ref_to_attribute/expected.rs @@ -1,8 +1,8 @@ -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct Id(pub String); impl Validate for Id {} -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(attribute, prefix = "tns", rename = "id")] diff --git a/xsd-parser/tests/rename_only_where_needed/expected.rs b/xsd-parser/tests/rename_only_where_needed/expected.rs index dba0e4a9..4c2d3f5a 100644 --- a/xsd-parser/tests/rename_only_where_needed/expected.rs +++ b/xsd-parser/tests/rename_only_where_needed/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns")] diff --git a/xsd-parser/tests/restriction_any_type/expected.rs b/xsd-parser/tests/restriction_any_type/expected.rs index efa1be41..fc6aaf80 100644 --- a/xsd-parser/tests/restriction_any_type/expected.rs +++ b/xsd-parser/tests/restriction_any_type/expected.rs @@ -1,5 +1,5 @@ // pub type AppSequence = AppSequenceType; -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://schemas.xmlsoap.org/ws/2005/04/discovery")] pub struct AppSequenceType { #[yaserde(attribute, rename = "InstanceId")] diff --git a/xsd-parser/tests/simple_type/expected.rs b/xsd-parser/tests/simple_type/expected.rs index a67851b5..44ecaf94 100644 --- a/xsd-parser/tests/simple_type/expected.rs +++ b/xsd-parser/tests/simple_type/expected.rs @@ -1,2 +1,2 @@ -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct FooType (pub String); diff --git a/xsd-parser/tests/tuple_with_integer/expected.rs b/xsd-parser/tests/tuple_with_integer/expected.rs index 2e78b1cf..8a6fd500 100644 --- a/xsd-parser/tests/tuple_with_integer/expected.rs +++ b/xsd-parser/tests/tuple_with_integer/expected.rs @@ -1,2 +1,2 @@ -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct FooType (pub Integer); diff --git a/xsd-parser/tests/tuple_with_string/expected.rs b/xsd-parser/tests/tuple_with_string/expected.rs index ef82ccf1..89a59481 100644 --- a/xsd-parser/tests/tuple_with_string/expected.rs +++ b/xsd-parser/tests/tuple_with_string/expected.rs @@ -1,2 +1,2 @@ -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct FooType(pub String); diff --git a/xsd-parser/tests/tuple_with_vec/expected.rs b/xsd-parser/tests/tuple_with_vec/expected.rs index d7968913..c25fa971 100644 --- a/xsd-parser/tests/tuple_with_vec/expected.rs +++ b/xsd-parser/tests/tuple_with_vec/expected.rs @@ -1,2 +1,2 @@ -#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] +#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)] pub struct FooType(pub Vec); diff --git a/xsd-parser/tests/type_name_clash/expected.rs b/xsd-parser/tests/type_name_clash/expected.rs index d24d8322..076e214e 100644 --- a/xsd-parser/tests/type_name_clash/expected.rs +++ b/xsd-parser/tests/type_name_clash/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct BarType { #[yaserde(attribute, rename = "a")] @@ -8,7 +8,7 @@ pub struct BarType { impl Validate for BarType {} -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "Bar")] @@ -20,7 +20,7 @@ impl Validate for FooType {} pub mod foo_type { use super::*; - #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] + #[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct BarType { #[yaserde(attribute, rename = "b")] diff --git a/xsd-parser/tests/xsd_string/expected.rs b/xsd-parser/tests/xsd_string/expected.rs index d6acd2c4..1d0528c5 100644 --- a/xsd-parser/tests/xsd_string/expected.rs +++ b/xsd-parser/tests/xsd_string/expected.rs @@ -1,4 +1,4 @@ -#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)] +#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)] #[yaserde(prefix = "tns", namespace = "tns: http://example.com")] pub struct FooType { #[yaserde(prefix = "tns", rename = "Text")]