Skip to content
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

Customize encoders and decoders for UserStorage Properties #50

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Oct 30, 2024

Customize encoders and decoders for UserStorage Properties

♻️ Current situation & Problem

SpeziScheduler uses the property list encoders and decoders by default for UserStorage properties for an efficient encoded representation. Certain types don't quite work well with the property list encoder. For example FHIRs ModelR4 seem to be heavily tailored towards a JSON representation and fail to decode when using property lists. Therefore, this PR adds the ability to customize the encoder and decoder used with a Property.

⚙️ Release Notes

  • Added coding argument to the Property macro.

📚 Documentation

Documentation was supplied.

✅ Testing

Additional unit testing verifies the updated macro generation.

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@Supereg Supereg changed the title Feature/customize coding Customize encoders and decoders for UserStorage Properties Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.76%. Comparing base (7ba1ed8) to head (80dab24).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...es/SpeziScheduler/UserInfo/UserStorageCoding.swift 57.15% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   70.60%   70.76%   +0.16%     
==========================================
  Files          40       41       +1     
  Lines        2697     2722      +25     
==========================================
+ Hits         1904     1926      +22     
- Misses        793      796       +3     
Files with missing lines Coverage Δ
Sources/SpeziScheduler/Task/Outcome.swift 20.52% <ø> (ø)
Sources/SpeziScheduler/Task/Task.swift 68.61% <ø> (ø)
Sources/SpeziScheduler/UserInfo/UserInfoKey.swift 0.00% <ø> (ø)
...rces/SpeziScheduler/UserInfo/UserInfoStorage.swift 65.00% <100.00%> (+0.60%) ⬆️
...s/SpeziSchedulerMacros/UserStorageEntryMacro.swift 92.09% <100.00%> (+1.11%) ⬆️
...es/SpeziScheduler/UserInfo/UserStorageCoding.swift 57.15% <57.15%> (ø)

Continue to review full report in Codecov by Sentry.

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

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice small addition, very cool! 🚀

@Supereg Supereg merged commit a4923dc into main Oct 30, 2024
11 checks passed
@Supereg Supereg deleted the feature/customize-coding branch October 30, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants