Skip to content

RetrievePagePropertyItem for status property failed #325

@hikeda

Description

@hikeda

If the page contains status property, PagesClient.RetrievePagePropertyItem throws the following exception. (version: 4.0.0-preview-5.9.15.2022)

Newtonsoft.Json.JsonSerializationException: Could not create an instance of type Notion.Client.IPropertyItemObject. Type is an interface or abstract class and cannot be instantiated. Path 'object', line 1, position 10. at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at JsonSubTypes.JsonSubtypes.ThreadStaticReadObject(JsonReader reader, JsonSerializer serializer, JToken jToken, Type targetType) at JsonSubTypes.JsonSubtypes.ReadJson(JsonReader reader, Type objectType, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader) at Notion.Client.Extensions.HttpResponseMessageExtensions.ParseStreamAsync[T](HttpResponseMessage response, JsonSerializerSettings serializerSettings) at Notion.Client.RestClient.GetAsync[T](String uri, IDictionary`2 queryParams, IDictionary`2 headers, JsonSerializerSettings serializerSettings, CancellationToken cancellationToken) at Notion.Client.PagesClient.RetrievePagePropertyItem(RetrievePropertyItemParameters retrievePropertyItemParameters) 

This page does not describe the status property, but actually returns the following JSON

{ "object": "property_item", "type": "status", "id": "_PDs", "status": { "id": "7e50ec50-e5ee-40ee-88e3-36811e956e88", "name": "In progress", "color": "blue" } } 

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions