-
Notifications
You must be signed in to change notification settings - Fork 112
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
Encode element with empty key, empty element, and attributes #223
Conversation
Codecov Report
@@ Coverage Diff @@
## main #223 +/- ##
==========================================
+ Coverage 73.87% 73.94% +0.06%
==========================================
Files 46 46
Lines 2431 2437 +6
==========================================
+ Hits 1796 1802 +6
Misses 635 635
Continue to review full report at Codecov.
|
@@ -217,9 +217,16 @@ struct XMLCoderElement: Equatable { | |||
_ string: inout String, | |||
_ charactersEscapedInAttributes: [(String, String)] | |||
) { | |||
let actuallyAttributes = self.elements.filter { | |||
$0.key.isEmpty && $0.elements.isEmpty && !$0.attributes.isEmpty |
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.
is key
a critical check here? Maybe your original case fails because of the key value intrinsic feature described here? https://github.com/MaxDesiatov/XMLCoder#coding-key-value-intrinsic
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.
Would you be able to add some unit tests here? On the surface these changes do make sense if they resolve your use case. But I'd like to see that use case isolated as a unit test first.
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.
Seems legit, thanks
… into chore/emptyKeyAttributev2
WOW you are toooo quick! haha.. I removed the ignore swift lint, and just reduced the name so that it is under 200 characters, thanks! |
…ice#223) Fixes an edge case with intrinsic value key encoding.
Original description is in this issue:
#224