Skip to content

Commit

Permalink
fix: allow setting properties to null
Browse files Browse the repository at this point in the history
  • Loading branch information
mzahor committed Jan 13, 2025
1 parent 18d3dab commit 8fc2848
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,5 @@ MigrationBackup/

# Rider
.idea/

.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class EmailPropertyValue : PropertyValue
/// <summary>
/// Describes an email address.
/// </summary>
[JsonProperty("email")]
[JsonProperty("email", NullValueHandling = NullValueHandling.Include)]
public string Email { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class NumberPropertyValue : PropertyValue
/// <summary>
/// Value of number
/// </summary>
[JsonProperty("number")]
[JsonProperty("number", NullValueHandling = NullValueHandling.Include)]
public double? Number { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PhoneNumberPropertyValue : PropertyValue
/// <summary>
/// Phone number value
/// </summary>
[JsonProperty("phone_number")]
[JsonProperty("phone_number", NullValueHandling = NullValueHandling.Include)]
public string PhoneNumber { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public enum StatusColor

public override PropertyValueType Type => PropertyValueType.Status;

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

public class Data
Expand Down
2 changes: 1 addition & 1 deletion Src/Notion.Client/Models/PropertyValue/UrlPropertyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UrlPropertyValue : PropertyValue
/// <summary>
/// Describes a web address
/// </summary>
[JsonProperty("url")]
[JsonProperty("url", NullValueHandling = NullValueHandling.Include)]
public string Url { get; set; }
}
}

0 comments on commit 8fc2848

Please sign in to comment.