This release changes the behavior of attributes coding: now order of XML attributes is fully preserved. One of the benefits is that it improves unit testing for users of XMLCoder, which allows testing against specific encoded attributes without accounting for their randomized order. Also a small coding style fix is included. In addition, XMLCoder now uses Azure Pipelines instead of Travis for CI with great improvements to overall CI stability, speed, and parallel builds. Thanks to Andrés Cecilia Luque and Jay Hickey for the contributions!
- Change components variable from var to let #107 (jayhickey)
- Keep the order of the attributes during encoding operations #110 (acecilia)
- Migrate from Travis to Azure Pipelines #111 (MaxDesiatov)
An improvement release that introduces convertFromKebabCase and
convertToKebabCase key decoding strategies. There were a few changes that
aren't visible to end-users: the way that keys and values are stored internally
has changed and a few more tests added. Thanks to Andrés Cecilia
Luque and Vincent
Esche for the contributions!
- Add support for kebab-case KeyDecodingStrategy #105 (acecilia)
- Replace UnkeyedBox with Array, refine KeyedStorage #102 (MaxDesiatov)
- Add tests for nested keyed/unkeyed collections #38 (regexident)
Bugfix release that restores decoding of empty sequences, which became broken in 0.5.0.
- Fix decoding of empty sequences #98 (MaxDesiatov)
- Rename
flattentotransformToBoxTree, rename tests #97 (MaxDesiatov)
A small improvement release tagged early to resolve blocking issues in CoreXLSX.
- Empty value strings are no longer decoded as
nilwhen aStringis expected, but are decoded as empty strings, which represents the actual value. trimValueWhitespacesproperty was added onXMLDecoder, which allows overriding the default behaviour, where starting and trailing whitespaces are trimmed from string values.
- Trimmed whitespace on decoding
String#94
- Fixed a bug when decoding a key with one character only #96 (TheFlow95)
- Add more cases to
AttributedIntrinsicTest#95 (MaxDesiatov) - Use
mapinstead ofmapValues/shuffleinXMLCoderElement.flatten#93 (jsbean) - Fix decoding empty element as optional #92 (MaxDesiatov)
A bugfix release removing unused Xcode project scheme to improve build time for Carthage users.
- Remove unused scheme in Xcode project, @MaxDesiatov)
This is a release with plenty of new features that allow you to parse many more XML variations than previously. Compatibility with Xcode 10.2 and Swift 5.0 is also improved. A huge thank you to @JoeMatt and @regexident for their contributions, to @hodovani for maintaining the project, and to @Inukinator, @qmoya, @Ma-He, @khoogheem and @thecb4 for reporting issues during development!
- Ordered encoding: this was one of the most requested changes and it's finally
here! 🎉 Now both keyed and unkeyed elements are encoded in the exactly same
order that was used in original containers. This is applicable to both
compiler-generated encoding implementations (just reorder properties or cases
in your
CodingKeysenum if you have it) and manually implementedfunc encode(to: Encoder). - Stripping namespace prefix: now if your coding key string values contain an
XML namespace prefix (e.g. prefix
hin<h:td>Apples</h:td>), you can setshouldProcessNamespacesproperty totrueon yourXMLDecoderinstance for the prefix to be stripped before decoding keys in yourDecodabletypes. - Previously it was possible to customize encoding with
NodeEncodingStrategy, but no such type existed for decoding. A correspondingNodeDecodingStrategytype was added withnodeDecodingStrategyproperty onXMLDecoder. - Thanks to the previous change, XMLCoder now provides two helper protocols that
allow you to easily customize whether nodes are encoded and decoded as
attributes or elements for conforming types:
DynamicNodeEncodingandDynamicNodeDecoding. - Previously if you needed to decode or encode an XML element with both
attributes and values, this was impossible to do with XMLCoder. Now with the
addition of coding key value
intrinsic,
this is as easy as adding one coding key with a specific string raw value
(
"value"or empty string""if you already have an XML attribute named"value").
- Crash: Range invalid bounds in XMLStackParser.swift #83
- Document DynamicNodeEncoding and attributed intrinsic #80
- Fix nested attributed intrinsic #78
- nodeEncodingStrategy #49
- XmlEncoder: ordering of elements #17
- Can’t reach an XML value #12
- Make value intrinsic smarter #89 (@MaxDesiatov)
- Refactor XMLCoderElement.flatten, add tests #88 (@MaxDesiatov)
- Add separate lint stage to .travis.yml #87 (@MaxDesiatov)
- Add multiple Xcode versions to Travis build matrix #86 (@MaxDesiatov)
- Add DynamicNodeDecoding protocol #85 (@MaxDesiatov)
- Improve tests and fix error context handling #84 (MaxDesiatov)
- Ordered encoding #82 (@MaxDesiatov)
- Add
shouldProcessNamespacesdecoder property #81 (@MaxDesiatov) - Fix nested attributed intrinsic #79 (@MaxDesiatov)
- Fix compatibility with Swift 5.0 #77 (@MaxDesiatov)
- Attributed Intrinsic (value coding key) #73 (JoeMatt)
- Dynamic node encoding + new formatters + various fixes #70 (@JoeMatt)
- Add
NodeDecodingStrategy, mirroringNodeEncodingStrategy#45 (@regexident)
A bugfix release that adds missing CFBundleVersion in generated framework's
Info.plist (#72 reported by
@stonedauwg).
- Set
CURRENT_PROJECT_VERSIONin project file (#74, @MaxDesiatov)
A maintenance release focused on fixing bugs, improving error reporting and overall internal architecture of the library. For this release we've started tracking test coverage and were able to increase it from 11.8% to 75.6%. 🎉 Thanks to @hodovani and @regexident for their work on improving test coverage in this release.
You can now set errorContextLength: UInt property on XMLDecoder instance,
which will make it add a snippet of XML of at most this length from parser state
when a parsing error occurs. This change was provided by
@hodovani and can greatly help with attempts to
parse invalid XML, where previously only a line and column number were reported.
NodeEncodingStrategies was renamed to NodeEncodingStrategy for consistency.
NodeEncodingStrategies is still available as a deprecated typealias, which
will be removed in future versions. Thanks to
@regexident for cleaning this up and providing
many more changes in this release that make XMLCoder better and easier to use.
- Add SwiftLint and fix linter errors (#35, @MaxDesiatov)
- Add single array element example to tests (#66, @MaxDesiatov)
- Remove generic encode/decode functions (#64, @hodovani)
- Change internal representation to ordered array of children (#55, @regexident)
- Keyed/unkeyed boxes as structs (#36, @regexident)
- Add dedicated benchmarking test suite (#34, @regexident)
- Add tests to increase test coverage (#63, @hodovani)
- Add tests for keyed and unkeyed int types (#62, @hodovani)
- Add test to case when error context size goes outside content size (#61, @hodovani)
- Specify Swift version for packaging, refine CI (#60, @MaxDesiatov)
- Add test for keyed Int types (#58, @hodovani)
- Fix missing trailing semicolon in character escapings (#59, @regexident)
- Increase test coverage (#56, @hodovani)
- Fix
RelationshipsTest.testDecodercrash on failure (#50, @regexident) - Improve
XMLStackParserTeststo test against CDATA blocks (#51, @regexident) - Remove unnecessary use of
@available(…)forOutputFormatting.sortedKeys(#53, @regexident) - Fix decoding of arrays with optional elements (#48, @MaxDesiatov)
- Add Optional Error Context (#46, @hodovani)
- Install Carthage only in before_deploy on Travis (#47, @MaxDesiatov)
- Add coding style and test coverage to README.md (#44, @MaxDesiatov)
- Improve code coverage of auxiliary types (#43, @regexident)
- Improve code coverage of box types (#42, @regexident)
- Make error handling in
XMLDecodersimpler & safer (#41, @regexident) - Unfold
guard … elseblocks to allow settingbreakpoints (#39, @regexident) - Cleanup throwing unit tests & add tests for missing values (#40, @regexident)
- Let compiler synthesize Equatable conformance for _XMLElement (#33, @jsbean)
- Apply SwiftFormat on CI runs (#32, @MaxDesiatov)
- Fix a bug with throws on
Encodableencoding nothing (#31, @regexident) - Clean up
XMLElement,ArrayBox&DictionaryBox(#28, @regexident) - Extract URL coding into
URLBoxwith tests (#30, @regexident) - Remove use of explicit
internal(#29, @regexident) - Clean up coding logic, improve box naming (#27, @regexident)
- Clean up
XMLStackParser(#26, @regexident) - Overhaul internal representation, replacing
NS…with…Boxtypes (#19, @regexident) - Added benchmark to RJI test suite (#20, @regexident)
- Fix generation of Jazy docs (#18, @MaxDesiatov)
- Added unit tests for array and dictionary properties (#7, @regexident)
- Moved
_XML…EncodingContainerinto their own files, matching decoder (#4, @regexident) - Convert
Sample XMLcode to XCTest (#1, @MaxDesiatov) - Respect .sortedKeys option, add .swiftformat (@qmoya)
- Bring back
gem install cocoapods --preto Travis (@MaxDesiatov) - Add --verbose flag to
pod lib lintin travis.yml (@MaxDesiatov) - Specify stable versions in the installation guide (@MaxDesiatov)
- Implement Travis CI deployment of Carthage archive (@MaxDesiatov)
- Add NodeEncodingStrategies typelias as deprecated (#9, @MaxDesiatov)
- Rename
NodeEncodingStrategiesto match other type names (#8, @regexident) - Consider node encoding strategy for values inside unkeyed containers (#2, @regexident)
- Run tests with coverage, upload to codecov.io (@MaxDesiatov)
- watchOS deployment target set to 2.0 for Carthage (@MaxDesiatov)
- Add watchOS 2.0 deployment target (@MaxDesiatov)
- Set iOS deployment target to 9.0 (@MaxDesiatov)
- Add support for decoupled, type-dependent node-encoding strategies (@regexident)
- Add missing visibility declarations (@regexident)
- Improve
.gitignoreand remove tracked*.xcuserdatafiles (@regexident) - Make
XMLEncoder.OutputFormatting.prettyPrintedactually do something (@regexident) - Add tvOS deployment target to podspec (@edc1591)
- Fix Carthage command (@salavert)
- Set deployment versions to allow older SDKs (@Lutzifer)
- Add Info.plist to allow Framework use in App Store Connect via Carthage (@Lutzifer)
- Set
CURRENT_PROJECT_VERSION(@Lutzifer) - Add
convertFromCapitalizedstrategy, simple test (@MaxDesiatov) - Allow older iOS/tvOS deployment targets in podspec (@MaxDesiatov)