-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapping a list of element and primitive nodes #710
Conversation
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #710 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 100 101 +1
Lines 8741 8776 +35
Branches 2212 2220 +8
=========================================
+ Hits 8741 8776 +35
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @cercide let's also take care of the coverage please
Kudos, SonarCloud Quality Gate passed! |
Thank you for the contribution @cercide this is something I wanted to tackle at some point!!! |
📒 Description
XML data structures commonly wrap element and primitive collections. For instance, a library may have several books
and and other stuff as well. In terms of OpenAPI 3, these data
structures are
wrapped
. Hence, this PR introduces the field parameterwrapper
, which wraps any element/primitivecollection into a custom xml element without the need of a dedicated wrapper class.
Resolves #709
🔗 What I've Done
First, a new metadata attribute
wrapper
indicates that a list is wrapped by an xml object.Next, when the serializer writes a list, the
wrapper
attribute triggersXmlWriterEvent.START
end before the serializer writes the list. Afterwards, anXmlWriterEvent.END
event follows vice versa .Finally, the parser introduces the class
WrapperNode
as a subclass ofXmlNode
. TheWrapperNode
class is a wrapper for the parent element and lines up into the node queue.💬 Comments
This is a great library to work in pythonik way with xml. Thank you for your efforts!
🛫 Checklist