-
Notifications
You must be signed in to change notification settings - Fork 582
Update serializer settings to include default values #273 #275
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
Conversation
Awesome! Could you please sign our CLA to get this merged? https://github.com/sendgrid/sendgrid-csharp/blob/master/CONTRIBUTING.md#cla Thanks! |
I have signed the CLA and sent it to dx@ |
I will need to give this one some more thought. The failing TestHelloEmail test happens because your change allows I'm thinking we need to instead build the object piece by piece and then deserialize that object vs trying to deserialize the entire Mail object and figuring out which values to ignore properly. |
How about making it nullable? That way it wont be included. |
I was thinking about trying this: https://msdn.microsoft.com/en-us/library/53b8022e(v=vs.110).aspx |
I like the nullable idea also. |
Good idea http://www.newtonsoft.com/json/help/html/conditionalproperties.htm I think a nullable property would be easier. Is it any more property that should not be serialized with its default value? |
Generally, if you don't set a value, then it should not show up. |
Seems like if we go the nullable route, we need to initialize the values to null. Looking at the failed test, it looks like we still get |
I missed to make sendAt in mail nullable. Fixed :) |
Nice work! I'm hoping to have some time to review today. |
I just put in a pull request on your fork that adds in the rest of the nullable fixes, plus an additional unit test. |
Sync with Master + Add nullable fix to remainder of Mail.cs + Add Unit Test
Fixing merge conflicts with #275
Please shoot us an email to [email protected] with your mailing address and T-shirt size so we can send you a token of our appreciation. |
Thank you very much! :) |
Add 'Sending email with attachment' Use Case
Changed json serializer settings to include default values to fix issue #273
The default implementation removes the enable flags from tracking settings if set to false. Resulting in:
The click_tracking(etc) enable parameter is required.