Closed ephraimkunz closed 3 years ago
Totals | |
---|---|
Change from base Build 272: | 0.02% |
Covered Lines: | 1125 |
Relevant Lines: | 1886 |
FYI, I'm not intending to work on #76 any time soon. I didn't hear any interest from the project owner so I found other things to work on.
Any ideas if / when someone could take a look at this PR? No huge rush, but I'm working on a library that depends on these changes and I'd like to avoid having to publish a fork of yaserde if possible.
Fixes #110.
Nested structs with the same field names don't deserialize correctly. #76 gives a more detailed description of the problem and provides a more comprehensive proposal for fixing it that involves a larger change to the internal workings of yaserde.
However, I needed a fix sooner than that large refactoring. This fix passes all tests including the test that checks this specific nested case.
It moves the check for the root attribute above the checks for the child attributes, so we avoid matching on a child attribute with the same name as the root attribute when what we have actually pulled from the reader is the root attribute.