We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 03328f5 + 075f6b0 commit d476e85Copy full SHA for d476e85
README.md
@@ -97,7 +97,7 @@ There are cases when schema allows extensions for the certain type.
97
In such cases we don't know in advance what fields must be present in Rust struct so we don't add them to output:
98
99
```rust
100
-#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
+#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]
101
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
102
pub struct MyType {
103
#[yaserde(prefix = "tns", rename = "Parameters")]
wsdl-parser/tests/port_type_to_function/expected.rs
@@ -1,5 +1,5 @@
1
2
3
#[yaserde(prefix = "tds", namespace = "tds: http://www.onvif.org/ver10/device/wsdl")]
4
pub struct GetServices {
5
// Indicates if the service capabilities (untyped) should be included in the
@@ -11,7 +11,7 @@ pub struct GetServices {
11
impl Validate for GetServices {}
12
13
14
15
16
pub struct GetServicesResponse {
17
// Each Service element contains information about one service.
xsd-parser/src/generator/enum.rs
@@ -65,7 +65,7 @@ pub trait EnumGenerator {
65
return "#[derive(PartialEq, Debug, UtilsUnionSerDe)]".into();
66
}
67
68
- let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]";
+ let derives = "#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]";
69
let tns = gen.target_ns.borrow();
70
match tns.as_ref() {
71
Some(tn) => match tn.name() {
xsd-parser/src/generator/mod.rs
@@ -92,7 +92,8 @@ mod test {
92
..Default::default()
93
}));
94
let comment = "// comment\n";
95
- let macros = "#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
+ let macros =
96
+ "#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n";
let validation = "impl Validate for Name {}\n";
let expected =
format!("{}{}pub struct Name (pub Type);\n\n{}", comment, macros, validation);
xsd-parser/src/generator/struct.rs
@@ -79,7 +79,7 @@ pub trait StructGenerator {
79
80
81
fn macros(&self, _entity: &Struct, gen: &Generator) -> Cow<'static, str> {
82
- let derives = "#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]\n";
+ let derives = "#[derive(Default, Clone, PartialEq, Debug, YaSerialize, YaDeserialize)]\n";
83
84
85
xsd-parser/src/generator/tuple_struct.rs
@@ -39,7 +39,7 @@ pub trait TupleStructGenerator {
39
40
41
fn macros(&self, _entity: &TupleStruct, _gen: &Generator) -> Cow<'static, str> {
42
- "#[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n".into()
+ "#[derive(Default, Clone, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]\n".into()
43
44
45
fn format_comment(&self, entity: &TupleStruct, gen: &Generator) -> String {
xsd-parser/tests/all/expected.rs
@@ -1,4 +1,4 @@
pub struct FooType {
#[yaserde(prefix = "tns", rename = "Once")]
xsd-parser/tests/any/expected.rs
#[yaserde(prefix = "tns", rename = "Name")]
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);
pub struct BazType(pub i32);
6
7
-#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]
+#[derive(PartialEq, Debug, Clone, YaSerialize, YaDeserialize)]
8
9
pub enum FooTypeChoice {
10
Bar(BarType),
@@ -18,7 +18,7 @@ impl Default for FooTypeChoice {
18
19
20
21
22
23
24
#[yaserde(flatten)]
xsd-parser/tests/complex_type/expected.rs
#[yaserde(prefix = "tns", rename = "Min")]
0 commit comments