Closed Supereg closed 2 months ago
Attention: Patch coverage is 95.65217%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 84.82%. Comparing base (
40fa3f5
) to head (0d9eb77
). Report is 1 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
...ountValue/Collections/AccountDetails+Codable.swift | 95.00% | 1 Missing :warning: |
Encoding and Decoding of AccountDetails with strongly typed configuration
:recycle: Current situation & Problem
The current approach of decoding and encoding
AccountDetails
relies on setting the expecteduserInfo
keys on the encoder and decoder instance. While is highlighted in documentation, there is no compile-time check that there isn't any mistake in the configuration (e.g., missing keys or values with unexpected type). iOS 17 introduced theCodableWithConfiguration
protocols that allow to set a configuration type for encoding and decoding. This PR migrates the current approach to adopting theEncodableWithConfiguration
protocol and replacing theDecodable
conformance withDecodableWithConfiguration
. The requirement to pass a configuration upon decoding is now expressed with the type system and will produce a compiler warning if not done correctly.:gear: Release Notes
EncodingConfiguration
andDecodingConfiguration
for AccountDetails and conformance toCodableWithConfiguration
. TheDecodable
conformance was dropped.:books: Documentation
Documentation was added for new interfaces and updated to point to the new configuration types.
:white_check_mark: Testing
Existing unit test verify that the new implementation doesn't break any expected behavior.
:pencil: Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: