sendgrid

How to handle both a single item and an array for the same property using JSON.net

半城伤御伤魂 提交于 2019-11-25 21:39:43
问题 I\'m trying to fix my SendGridPlus library to deal with SendGrid events, but I\'m having some trouble with the inconsistent treatment of categories in the API. In the following example payload taken from the SendGrid API reference, you\'ll notice that the category property for each item can either be a single string or an array of strings. [ { \"email\": \"john.doe@sendgrid.com\", \"timestamp\": 1337966815, \"category\": [ \"newuser\", \"transactional\" ], \"event\": \"open\" }, { \"email\":