-
Notifications
You must be signed in to change notification settings - Fork 23
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
Possibility of custom attributes not being successfully sent to the API. #112
Comments
This ticket needs a test case to see if this is actually a bug. A unit test should suffice. If this is indeed a bug, one idea to fix the issue is to remove the ability to provide a custom |
This is a non-issue. Our API doesn't have any actual strong requirements on data formats, nor will it ignore data in the wrong format. Our impl of the Under the hood our segmentation does some clever tricks to decide when values are of a given type, but stores everything as strings. So in conclusion: I don't think we need to make any changes here - unless we think the |
I originally had the idea of allowing customers to provide their own However, there are some flaws to this implementation:
After reading the docs for JSONEncoder to see all the capabilities it provides, I see this solution has more harms then value. Especially when there is a different solution that is not only easier to implement by a customer, but it removes all of the harms that the current implementation provides. Not only that, but when you think about it, it doesn't make much sense to allow a custom |
version 1.0.0-alpha.25
Expected behavior
Public SDK functions that allow adding user attributes (such as
CustomerIO.identify()
) allow an optionalJSONEncoder
to be passed in. The main use case here is that if a customer wants user attributes to show up as "firstName" in fly.customer.io for example, they can. We want to give you the ability to modify the keys of the JSON.Actual behavior
Customers providing their own
JSONEncoder
not only can modify the keys but also the values of JSON. This is a bad thing because our API requires dates to be in a certain format, for example. If a customer provides a customJSONEncoder
that encodesDate
in a way that is not compatible with our API, there is a chance that value in the JSON will be ignored by the API.The text was updated successfully, but these errors were encountered: