CoreOffice / XMLCoder

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

Add convert from UPPERCASE decoding key strategy #214

Closed huwr closed 3 years ago

huwr commented 3 years ago

This will convert from ALL_CAPS_SNAKE_CASE to camelCase.

Previously, there was only snake_case, kebab-case, and first-letter-only Capitalised. To do ALL_CAPS, one needed to use a custom key decoding strategy.

I've been using this to make a decoder for BeerXML, which tends to have the keys capitalised.

codecov[bot] commented 3 years ago

Codecov Report

Merging #214 (0e19ae8) into main (a469f60) will increase coverage by 0.12%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
+ Coverage   73.50%   73.62%   +0.12%     
==========================================
  Files          46       46              
  Lines        2404     2408       +4     
==========================================
+ Hits         1767     1773       +6     
+ Misses        637      635       -2     
Impacted Files Coverage Δ
Sources/XMLCoder/Decoder/XMLDecoder.swift 78.41% <100.00%> (+1.77%) :arrow_up:
...es/XMLCoder/Decoder/XMLDecoderImplementation.swift 67.74% <100.00%> (+0.19%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a469f60...0e19ae8. Read the comment docs.