-
Notifications
You must be signed in to change notification settings - Fork 38
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
UniqueArguments omitted when serializing a webhook event #493
Comments
@elmalakai here's a beta version of the next package that will properly serialize uniqueargs: https://www.myget.org/feed/jericho/package/nuget/StrongGrid/0.101.0-beta0005 The only concession we have to make is that unique arguments with a numerical value will be serialized as a string like so:
which is not 100% same as the original JSON received from SendGrid but it's the best we can do due to the fact that unknown values must be cast as string in order to be added to the |
I struggle with this a lot in dealing with JSON everywhere. Lately I use Dictionary<string,object> and use one of the many System.Text.Json 'generic' object converters out there to store the value as strongly typed (double, bool, null, string, array). I think for now, treating all unique arguments as strings is acceptable. Most of these arguments you add yourself to the message, so you know best how to parse and deal with them. |
Thanks for confirming. |
Looks like you had an bug in 0.101.0-beta0005 but I think you've fixed it. I tried to write a test case for it and it's working. Specifically, the UniqueArguments were being double wrapped in double quotes when deserialized:
Tried to write a test case for it, but I think you beat me to it (Webhook_includes_unknow_property). |
Yes, I confirm there was an issue with quotes being doubled but fixed it here: 04ba8b2#diff-bbf883778fe4acba4cb2d3272c16d800f7dcc6fcbf69c03f9415607d4af110fdR115 Using |
🎉 This issue has been resolved in version 0.101.0 🎉 The release is available on: Your GitReleaseManager bot 📦🚀 |
@elmalakai pointed out that
UniqueArguments
is omitted when serializing a webhook event.The text was updated successfully, but these errors were encountered: