Partial icon indicating copy to clipboard operation
Partial copied to clipboard

Add Codable support

Open JosephDuffy opened this issue 4 years ago • 3 comments

TODO

  • [x] Add Decodable support
  • [x] Add an equivalent to unwrapped that's added by PartialConvertible when Wrapped is PartialCodable
  • [ ] Support embedded partials, builders
  • [ ] Find a more appropriate name for PartialCodable

JosephDuffy avatar Jan 27 '21 13:01 JosephDuffy

Codecov Report

Merging #175 (79f8225) into master (8395463) will increase coverage by 1.94%. The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
+ Coverage   92.81%   94.75%   +1.94%     
==========================================
  Files           6        8       +2     
  Lines         153      381     +228     
==========================================
+ Hits          142      361     +219     
- Misses         11       20       +9     
Impacted Files Coverage Δ
Sources/Partial/Partial.swift 82.35% <72.72%> (-10.51%) :arrow_down:
Sources/Partial/PartialBuilder.swift 91.75% <75.00%> (-1.51%) :arrow_down:
...s/Partial/Codable/KeyPathCodingKeyCollection.swift 87.50% <87.50%> (ø)
...al/Codable/KeyPathCodingKeyCollectionBuilder.swift 100.00% <100.00%> (ø)

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 8395463...79f8225. Read the comment docs.

codecov[bot] avatar Jan 27 '21 13:01 codecov[bot]

That would be a really great feature!

Imagine I have a profile and a complete profile with details. Profile: id name

Full profile: id name email company

With this PR merged, I could merge models and parse them from JSON.

iSevenDays avatar Nov 19 '21 20:11 iSevenDays

That would be a really great feature!

Imagine I have a profile and a complete profile with details.

Profile:

id

name

Full profile:

id

name

email

company

With this PR merged, I could merge models and parse them from JSON.

This is certainly a good use case, I do plan to work on this when I have more spare time. I don't personally need this feature so it's not a top priority for me currently!

JosephDuffy avatar Nov 27 '21 21:11 JosephDuffy