Skip to content

feat: new strategy to skip encoding nested containers#57

Open
TizianoCoroneo wants to merge 1 commit intoalmazrafi:mainfrom
TizianoCoroneo:main
Open

feat: new strategy to skip encoding nested containers#57
TizianoCoroneo wants to merge 1 commit intoalmazrafi:mainfrom
TizianoCoroneo:main

Conversation

@TizianoCoroneo
Copy link

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.)

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.

1 participant