twilio-csharp
twilio-csharp copied to clipboard
Serializing MessageResource response object using Newtonsoft throws error
Issue Summary
Serialization of MessageResource with Newtonsoft.json fails when in place of 'from' parameter , 'messagingserviceid' is provided
Code Snippet
private async void CreateMessageResourceAsync(string serviceId, string recipient, string body)
MessageResource message = await MessageResource.CreateAsync
(
body: body,
messagingServiceSid: serviceId,
to: new PhoneNumber(recipient)
);
string str = JsonConvert.SerializeObject(message)
}
Exception/Log
System.Private.CoreLib: Exception while executing function: SendSmsAsync. Newtonsoft.Json: Value cannot be null. (Parameter 'o').
Technical details:
- twilio-csharp version: 5.46.2
- csharp version: .net core 3.1
- newtonsoft version: 12.0.3
Able to recreate this locally. Guessing it's because the from in the response is an empty string, but not positive.
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.
Any updates on this?
No update. Still in the backlog.
Do we have any updates here