feat: new strategy to skip encoding nested containers#57
Open
TizianoCoroneo wants to merge 1 commit intoalmazrafi:mainfrom
Open
feat: new strategy to skip encoding nested containers#57TizianoCoroneo wants to merge 1 commit intoalmazrafi:mainfrom
TizianoCoroneo wants to merge 1 commit intoalmazrafi:mainfrom
Conversation
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.
Hello!
I have a strange use-case that is not currently covered by your very nice library :) I'm in the process of integrating Customer.io in my app, but they recently deprecated the possibility to send Codable models to their API because they don't support having nested containers as values for user traits.
Customer.io SDK changelog
The pattern I've been using successfully with other analytics libraries is to define a Codable user properties model and then using DictionaryCoder to make a
[String: Any]value to send to these APIs, but now Customer.io requires me to basically skip nested containers. I could iterate the output of the encoder to remove the extra fields, but I feel like that's a more brittle solution than adding an option to the dictionary encoder.I added a strategy to the configuration options for the dictionary encoder for this purpose. Thank you again for making this very useful library.
(No AI was involved in making any part of this PR.)