You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first problem is compilation errors for the above schema:
error: proc-macro derive panicked
--> src/main.rs:11:17
|
11 | #[derive(Debug, XmlSchema)]
| ^^^^^^^^^
|
= help: message: not implemented
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Element: YaDeserialize` is not satisfied
--> src/main.rs:11:17
|
11 | #[derive(Debug, XmlSchema)]
| ^^^^^^^^^ the trait `YaDeserialize` is not implemented for `Element`
|
|
101 | fn deserialize<R: Read>(reader: &mut de::Deserializer<R>) -> Result<Self, String>;
| ---- required by this bound in `deserialize`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
Another problem seems it ignores attributes for complex types. For the schema above if I set store_generated_code, I see the following output:
The first problem with "proc-macro derive panicked" is actually a panic inside YaDeserialize for Option<Vec<..>>.
It was reported before for this package #4
Similar issue reported there media-io/yaserde#49 .
The fix imo would be for yaserde to provide more information in unimplemented! macro call
Root cause for this problem is incorrect handling of maxOccurs element attribute. It's not actually handled at all, even for missing maxOccurs it' still 1. #13 - this ticket's author suggested a solution.
Correct implementation should generate pub info : Option < String >
in this case.
As for the second problem, it's connected to the first one: this package handles nested compleType's differently than top-level
During some testing on the lib we've faced 2 problems:
Schema example:
The first problem is compilation errors for the above schema:
Another problem seems it ignores attributes for complex types. For the schema above if I set
store_generated_code
, I see the following output:There is no attribute
attrib
inElement
.Also, I've found this problem in the existing test (https://github.com/media-io/xml-schema/blob/master/xml_schema/tests/complex_type.rs): attribute
scope
is missing.The text was updated successfully, but these errors were encountered: