-
Notifications
You must be signed in to change notification settings - Fork 587
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
Feature Request: Custom serializer option to handle Dynamic Template Data serialization #985
Comments
Pull requests to add this feature are welcome and will be reviewed based on priority, but Twilio SendGrid is not actively building new functionality for the library. |
More than happy to do so! Following all guidelines! Looking at open pull requests, may I ask the time it may take to merge this functionality? |
@shervinw @eshanholtz Not sure if the pull request is already there? we have bumped into this with .net 5. #1050 |
No PRs yet, but they are welcome! |
Over an year now and still no support to native .net serializer... Aren't these client libraries supposed to supported by Twilio? There is even a PR just sitting there and really no real effort to make it happen. 3 days for now .net 2.1 end of support is there and this will not have happened. |
+1 |
@eshanholtz Does this mean that there will not be a version of this library with System.Text.Json support? Currently some of the types has a strong dependency on JSON.NET. Asking it here because1050 was closed as it was marked as dupe of this. Thanks! |
Would be good with some updates on this. We're hitting this as an issue as well when replacing Newtonsoft.Json with System.Text.Json. Most other libraries have a way to set a custom serializer which lets us configure them properly, but this library does not. Is development on this project stopped which means Twilio is no longer supplying an official C#/.NET SDK? Edit: As an ugly workaround, since we only seem to have issues with var templateDataJson = JsonSerializer.Serialize(templateData);
var njTemplateData = Newtonsoft.Json.JsonConvert.DeserializeObject<object?>(templateDataJson);
sendGridMessage.SetTemplateData(njTemplateData); Basically, we take the current template data (deserialized with STJ, so it has |
Had to employ the same ugly and ineffective solution @Sharparam . It's funny how they put it in the home page as they want this library to be community driven. But someone comes, makes all the effort (a lot of effort), keeps it updated, follow the guidelines and after almost an entire year and the pull request is still there: Don't think there is enough respect to the effort being made there. And this will never be community driven when there is a gatekeeper acting as a bottleneck for community driven work. |
If anybody is still waiting for a solution to customize how you dynamic template data is serialized, I suggest you have a look at StrongGrid which is an alternative to SendGrid's client (disclaimer: I'm the author). StrongGrid allows you to specify your own serialization options, including the naming policy. Hope this helps. |
example:
Current options are far too restrictive, I can only see that decorating properties with JsonProperty has any type of effect.
Also, I'm sure this test is simply testing Newtonsofts lib.
The text was updated successfully, but these errors were encountered: