Skip to content

Commit 2293f45

Browse files
Merge pull request #427 from mzahor/fix/null-props
fix: allow setting properties to null
2 parents a9e8c60 + 5551629 commit 2293f45

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,5 @@ MigrationBackup/
354354

355355
# Rider
356356
.idea/
357+
358+
.DS_Store

Src/Notion.Client/Models/PropertyValue/EmailPropertyValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class EmailPropertyValue : PropertyValue
1212
/// <summary>
1313
/// Describes an email address.
1414
/// </summary>
15-
[JsonProperty("email")]
15+
[JsonProperty("email", NullValueHandling = NullValueHandling.Include)]
1616
public string Email { get; set; }
1717
}
1818
}

Src/Notion.Client/Models/PropertyValue/NumberPropertyValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class NumberPropertyValue : PropertyValue
1212
/// <summary>
1313
/// Value of number
1414
/// </summary>
15-
[JsonProperty("number")]
15+
[JsonProperty("number", NullValueHandling = NullValueHandling.Include)]
1616
public double? Number { get; set; }
1717
}
1818
}

Src/Notion.Client/Models/PropertyValue/PhoneNumberPropertyValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PhoneNumberPropertyValue : PropertyValue
1212
/// <summary>
1313
/// Phone number value
1414
/// </summary>
15-
[JsonProperty("phone_number")]
15+
[JsonProperty("phone_number", NullValueHandling = NullValueHandling.Include)]
1616
public string PhoneNumber { get; set; }
1717
}
1818
}

Src/Notion.Client/Models/PropertyValue/StatusPropertyValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public enum StatusColor
4747

4848
public override PropertyValueType Type => PropertyValueType.Status;
4949

50-
[JsonProperty("status")]
50+
[JsonProperty("status", NullValueHandling = NullValueHandling.Include)]
5151
public Data Status { get; set; }
5252

5353
public class Data

Src/Notion.Client/Models/PropertyValue/UrlPropertyValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class UrlPropertyValue : PropertyValue
1212
/// <summary>
1313
/// Describes a web address
1414
/// </summary>
15-
[JsonProperty("url")]
15+
[JsonProperty("url", NullValueHandling = NullValueHandling.Include)]
1616
public string Url { get; set; }
1717
}
1818
}

0 commit comments

Comments
 (0)