notion-dotnet / notion-sdk-net

A Notion SDK for .Net
MIT License
181 stars 44 forks source link

Date mentions are not correctly serialized #413

Open matkoch opened 2 months ago

matkoch commented 2 months ago

The original Mention object allows to set ta date as follows:

mention.Mention.Date.Date = new Date { Start = ... }

This results in a serialized JSON that has 1 additional date property in the middle. Notion validation returns the following:

.mention.date.start should be defined, instead was `undefined`

I introduced a hotfix that skips the additional Date property:

public class MentionPatch : Mention
{
    [JsonProperty("date")]
    public Date Date1 { get; set; }
}