Closed rkttu closed 11 months ago
If anyone needs this, I created a fork, and added this class to get it working.
Have to add it as a known subtype in PropertyValue.cs, and add the enum:
[JsonSubtypes.KnownSubTypeAttribute(typeof(VerificationPropertyValue), PropertyValueType.Verification)]
[EnumMember(Value = "verification")]
Verification
using Newtonsoft.Json;
namespace Notion.Client
{
/// <summary>
/// Verification property value.
/// </summary>
public class VerificationPropertyValue : PropertyValue
{
public override PropertyValueType Type => PropertyValueType.Verification;
[JsonProperty("verification")]
public VerificationValue Verification { get; set; }
}
/// <summary>
/// Object containing verification type-specific data.
/// </summary>
public class VerificationValue
{
/// <summary>
/// The state of verification. Possible values are "verified" and "unverified".
/// </summary>
[JsonProperty("state")]
public string State { get; set; }
/// <summary>
/// Describes the user who verified this page.
/// </summary>
[JsonProperty("verified_by")]
public User VerifiedBy { get; set; }
/// <summary>
/// Date verification property values contain a date property value.
/// </summary>
[JsonProperty("date")]
public DatePropertyValue Date { get; set; }
}
}
Seeing that it's been a while since I raised this issue and it still hasn't been reviewed, I think I'll check to see if the project is still in development.
@rkttu I would still like to support this project but because of some work I couldn't spend time on it. I would try to see I can add support for this over a week.
This has been released as part of 4.2.0
Describe the bug A recent new Notion feature is the ability to turn the top of the document into a wiki database with a special type of database. Unlike other common databases, this adds a special attribute called "verification", which currently doesn't exist in Notion.Net, causing JSON interpretation errors.
To Reproduce Steps to reproduce the behavior:
Expected behavior The Notion.Client.PropertyValueType.Verification enumeration constant member must exist, and no JSON interpretation errors should appear at this stage.
Screenshots
Desktop:
Additional context I think you should look at other attributes as well, such as AI summarization.
With Notion promising big changes in the future, I expect to see even bigger changes in property types. Specifying property types as enumeration constants seems inefficient, as it requires Notion to release a package every time it adds a new property type. I'd like to see a more flexible way to do this.