notion-sdk-net icon indicating copy to clipboard operation
notion-sdk-net copied to clipboard

Date mentions are not correctly serialized

Open matkoch opened this issue 1 year ago • 0 comments

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; }
}

matkoch avatar Jun 13 '24 15:06 matkoch