Skip to content

Commit a8c8422

Browse files
Merge pull request #478 from younitec/master
Disable Json.Net reference handling for SendGrid objects
2 parents bbe5dca + 9c94ae7 commit a8c8422

21 files changed

+108
-14
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,6 @@ $RECYCLE.BIN/
321321

322322
# Windows shortcuts
323323
*.lnk
324+
325+
# Code
326+
/.vscode

src/SendGrid/Helpers/Mail/Model/ASM.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace SendGrid.Helpers.Mail
1111
/// <summary>
1212
/// An object allowing you to specify how to handle unsubscribes.
1313
/// </summary>
14+
[JsonObject(IsReference = false)]
1415
public class ASM
1516
{
1617
/// <summary>
@@ -23,7 +24,7 @@ public class ASM
2324
/// Gets or sets an array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.
2425
/// https://sendgrid.com/docs/User_Guide/Suppressions/recipient_subscription_preferences.html
2526
/// </summary>
26-
[JsonProperty(PropertyName = "groups_to_display")]
27+
[JsonProperty(PropertyName = "groups_to_display", IsReference = false)]
2728
public List<int> GroupsToDisplay { get; set; }
2829
}
2930
}

src/SendGrid/Helpers/Mail/Model/Attachment.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// Gets or sets an array of objects in which you can specify any attachments you want to include.
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class Attachment
1415
{
1516
/// <summary>

src/SendGrid/Helpers/Mail/Model/BCCSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// Gets or sets the address specified in the mail_settings.bcc object will receive a blind carbon copy (BCC) of the very first personalization defined in the personalizations array.
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class BCCSettings
1415
{
1516
/// <summary>

src/SendGrid/Helpers/Mail/Model/BypassListManagement.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. Ex: outage emails, or forgot password emails.
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class BypassListManagement
1415
{
1516
/// <summary>

src/SendGrid/Helpers/Mail/Model/ClickTracking.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// Allows you to track whether a recipient clicked a link in your email.
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class ClickTracking
1415
{
1516
/// <summary>

src/SendGrid/Helpers/Mail/Model/Content.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// Specifies the content of your email. You can include multiple mime types of content, but you must specify at least one. To include more than one mime type, simply add another object to the array containing the type and value parameters. If included, text/plain and text/html must be the first indices of the array in this order. If you choose to include the text/plain or text/html mime types, they must be the first indices of the content array in the order text/plain, text/html.*Content is NOT mandatory if you using a transactional template and have defined the template_id in the Request
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class Content
1415
{
1516
/// <summary>

src/SendGrid/Helpers/Mail/Model/EmailAddress.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// An email object containing the email address and name of the sender or recipient.
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class EmailAddress
1415
{
1516
/// <summary>

src/SendGrid/Helpers/Mail/Model/FooterSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// The default footer that you would like appended to the bottom of every email.
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class FooterSettings
1415
{
1516
/// <summary>

src/SendGrid/Helpers/Mail/Model/Ganalytics.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SendGrid.Helpers.Mail
1010
/// <summary>
1111
/// Allows you to enable tracking provided by Google Analytics.
1212
/// </summary>
13+
[JsonObject(IsReference = false)]
1314
public class Ganalytics
1415
{
1516
/// <summary>

0 commit comments

Comments
 (0)