-
Notifications
You must be signed in to change notification settings - Fork 328
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
Support non-JSON object decodable values in getMetadataValue
#4555
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great so far! We should add a test to ensure we don't break it again in the future and then ready to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this!!
Hey @aboedo is there a reason why Here's what I think it should be #4561 I don't know why these 2 methods should be different while one is only providing a default value. Otherwise I feel the name should explicit the difference. Wdyt? |
Checklist
purchases-android
and hybridsMotivation
When fetching an offering metadata value with
getMetadataValue(for:)
(without a default value), a primitive Decodable (likeString
) causes the JSON decoder to crash, as it assumes the value is a JSON object, but it isn't a valid top-level JSON type.Description
isValidJSONObject
method before attempting to serialize values