Added @IgnoreHashable property wrapper#1604
Merged
Merged
Conversation
This will be used for the new implementation of `CustomerInfoResponse`, and also for `var rawData: [String: Any]` properties that can't conform to `Hashable`, and that we wouldn't want to use for comparison since they contain duplicated data.
NachoSoto
added a commit
that referenced
this pull request
May 24, 2022
…1565) Follow up to #1496. Depends on ~~#1567, #1568, #1604~~. The solution implemented in #1496 was very simple, but [as pointed out by @joshdholtz](#1496 (comment)), it was only encoding the data that was formally decoded by the `struct`s. We had no test coverage for this, so it went unnoticed. The new solution adds a new field: ```swift @IgnoreEncodable @IgnoreHashable var rawData: [String: Any] ``` Which, together with a new helper method `decodeRawData()`, allows storing all the data to be used by `CustomerInfo`'s `RawDataContainer` implementation. Unfortunately, despite many attempts, I realized that this can't be abstracted into a property wrapper, because a `KeyedDecodingContainer` can't access the parent `Decoder`. That's why the `CustomerInfoResponse` and `CustomerInfoResponse.Entitlement` must manually call this method.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will be used for the new implementation of
CustomerInfoResponse, and also forvar rawData: [String: Any]properties that can't conform toHashable, and that we wouldn't want to use for comparison since they contain duplicated data.