Comments (6)
@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:
"reseller_id": "1234"
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 Dictionary<string, string>
.
from stronggrid.
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.
from stronggrid.
Thanks for confirming.
from stronggrid.
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:
? events[0].UniqueArguments["environment"]
"\"Production\""
Tried to write a test case for it, but I think you beat me to it (Webhook_includes_unknow_property).
from stronggrid.
Yes, I confirm there was an issue with quotes being doubled but fixed it here: 04ba8b2#diff-bbf883778fe4acba4cb2d3272c16d800f7dcc6fcbf69c03f9415607d4af110fdR115
Using .GetRawText()
to get the content of a JSON node containing a string includes the double quotes evidently (I didn't know). It's not a problem with nodes containing numerical values though.
from stronggrid.
🎉 This issue has been resolved in version 0.101.0 🎉
The release is available on:
Your GitReleaseManager bot 📦🚀
from stronggrid.
Related Issues (20)
- Webhook parser should implement an interface HOT 2
- Mark the LegacyCLient as obsolete HOT 1
- Remove obsolete members
- InternalMessageId on webhook Events not always being returned with .filter in the value HOT 6
- Rename the `Client` class
- `IpAddress.AssignedOn` can be null HOT 2
- Access modifier issue in SingleSend model HOT 3
- Vulnerabilities Detected HOT 13
- `The JSON value is not in a supported DateTime format` when searching for contacts HOT 1
- Improve the WebhookSettings resource to handle multiple webhook settings HOT 1
- Unable to create new Webhook settings HOT 1
- Unable to configure Oauth when updating an existing Webhokk settings HOT 1
- Improve logging template/scopes, or provide a logging delegate? HOT 5
- Unable to configure Oauth when testing webhooks HOT 1
- Unable to toggle signature verification for a event webhook HOT 1
- Unable to specify the Id of the desired event webhook settings when retrieving the public key HOT 1
- Missing method to delete an existing event webhook settings HOT 1
- Use .net8 HostedApplication to run integration tests HOT 1
- Further improve how we handle unsupported encodings when parsing InboundEmail webhooks HOT 1
- .NET 8 JsonException when trying to parse inbound email HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stronggrid.