-
Notifications
You must be signed in to change notification settings - Fork 44
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
[4.8.0] Serialization for TemplateModel of TemplatedPostmarkMessage doesn't seem to work with Dictionaries anymore #130
Comments
Hey @mvpindev, I try to reproduce the issue but I can't get the TemplateModel values to get serialised as arrays, could you provide a small code snippet? I tried var t1 = new Dictionary<string, object>
{
{ "tenant", new { name = "Name1", logoUrl = "http://test1" } }
};
var t2 = new Dictionary<string, object>
{
{ "tenant", new Dictionary<string, object> { { "name", "Name1" }, { "logoUrl", "http://test1" } } }
}; and I get below in both cases
|
I'll try to create one asap |
Hey @MariuszTrybus, i was able to pinpoint what actually is/was wrong. Currently our code works similar to the following:
Which converts the templateModel from the RequestBody to the following:
So i makes sense why it worked before in 4.7.12 where postmark-dotnet still used Newtonsoft internally. I guess this can be closed, im sorry for the confusion |
Thank you for creating the ticket and sharing your findings. It's an edge case but it may help others in the future. I am sorry for any inconvenience caused by the change. |
In the following screenshots "TemplateModel" is a Dictionary<string,object>
With previous Versions (Tested with 4.7.12)
Correctly converted by "JsonContent" in the "PostmarkClientBase.cs" class
With 4.8.0 every value of the dictionary gets converted to an array:
The text was updated successfully, but these errors were encountered: