API Support & FAQ

Ask a Question
Back to All

Updating Project Priority

Hello,

I'm fetching a project and trying to update it's relativePriority.

var project = await GetItemByIdAsync(projectId);

project.RelativePriority = new RelativePriority{
      Type = position,
      Id = relativeProjectId 
};

await UpdateItemAsync(project);

I'm getting the following error:

{"errors":[{"title":"Message Not Readable","detail":"Instantiation of [simple type, class com.liquidplanner.backend.api.v1.item.dto.ApiRelativePriority] value failed for JSON property type due to missing (therefore NULL) value for creator parameter type which is a non-nullable type","status":400,"code":"message_not_readable","meta":{"propertyName":"relativePriority.type"}}]}


This is RelativePriority class I created for deserializing the json:

public class RelativePriority
    {
        [JsonProperty("Id")]
        public int? Id { get; set; }
        [JsonProperty("Type")] 
        public string Type { get; set; } // options are "before", "after", "top", "bottom"
}

I deserialized the json payload before it's sending via API to verify that data is being passed correctly:

"relativePriority":{"Id":44476585,"Type":"after"}

What am I missing or doing wrong? Any insight is appreciated.