Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I am trying to remove and then to add some property for an object like in the excerpt bellow. The problem is I always receive the error: Invalid parameters [8]:Invalid parameters(Patch value not on valid JSON format.) and the curious thing I get it also for the remove operation. If I remove a property, why am I being asked for a value? Also, I tried to send an empty value correctly formatted as JSON, but to no avail.
Has anyone encountered this before?
Thanks a lot for any insights!
await transientObject.ApplyPatchesAsync(
new[]
{
new NxPatch
{
Op = NxPatchOperationType.Remove,
Path = "/ExtendsId",
//Value = JsonConvert.SerializeObject("")
}
}, true);
await transientObject.ApplyPatchesAsync(
new[]
{
new NxPatch
{
Op = NxPatchOperationType.Remove,
Path = "/ExtendsId",
Value = JsonConvert.SerializeObject("")
},
new NxPatch
{
Op = NxPatchOperationType.Add,
Path = "/sourceObjectId",
Value = JsonConvert.SerializeObject(obj.Id)
}
}, true);
I think that's the error you get when you try to remove an unknown property. The "Value" property isn't really relevant there. If you replace "/ExtendsId" with "/qExtendsId" (which is the path used by the engine), then it works.
I think that's the error you get when you try to remove an unknown property. The "Value" property isn't really relevant there. If you replace "/ExtendsId" with "/qExtendsId" (which is the path used by the engine), then it works.
@Øystein_Kolsrud as always, you are right! Again, my many thanks. 🙂
Great! Don't forget to mark the question as resolved.