Skip to content

RetrievePagePropertyItem for status property failed #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hikeda opened this issue Sep 15, 2022 · 3 comments
Closed

RetrievePagePropertyItem for status property failed #325

hikeda opened this issue Sep 15, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hikeda
Copy link

hikeda commented Sep 15, 2022

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"
    }
}
@KoditkarVedant KoditkarVedant added the bug Something isn't working label Sep 18, 2022
@KoditkarVedant
Copy link
Contributor

@hikeda I think we should also open issue at Notion for updating the document.

@KoditkarVedant KoditkarVedant self-assigned this Sep 18, 2022
@KoditkarVedant
Copy link
Contributor

Fix is available in 4.0.0-preview-6.9.19.2022

@KoditkarVedant KoditkarVedant added this to the 4.0.0 milestone Sep 18, 2022
@KoditkarVedant
Copy link
Contributor

4.0.0 Released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants