CoreOffice / XMLCoder

Easy XML parsing using Codable protocols in Swift
https://coreoffice.github.io/XMLCoder/
MIT License
793 stars 104 forks source link

Update doc comments, add `PropertyWrappersTest` #246

Closed MaxDesiatov closed 1 year ago

MaxDesiatov commented 1 year ago

When viewing documentation published at https://swiftpackageindex.com/CoreOffice/XMLCoder/main/documentation/xmlcoder, I noticed that some of the doc comments are missing, and we made some of the protocols public by mistake. I've added doc comments with example code and update those protocols accordingly.

Additionally, tests and a section in README.md for recently added property wrappers were missing, that's fixed as well.

MaxDesiatov commented 1 year ago

Hi @CoreOffice/xmlcoder-team, would you have a moment to take a look? I wanted to make sure we're on the same page in terms of documentation, so your PR review here would be appreciated. Thanks!

Joannis commented 1 year ago

What are the odds that people currently rely on this API? I’m not exactly for a breaking change, but I wonder what the impact would be

MaxDesiatov commented 1 year ago

What are the odds that people currently rely on this API? I’m not exactly for a breaking change, but I wonder what the impact would be

If you're referring to XMLAttributeProtocol, I think the odds are vanishingly low. It didn't bring in any new functionality to users and is just an internal hack to type-erase values stored in property wrappers, exposed as public by accident.

In theory, I could expect someone conforming to this protocol similarly by accident, but even doing that would require some conscious effort on their side, and they shouldn't be doing this in the first place. Since XMLCoder 1.0 haven't been tagged yet so far, I think it's acceptable to introduce this breaking change for the sake of having a cleaner API.