some-addition-86177
02/13/2023, 9:59 AMsome-addition-86177
02/13/2023, 10:13 AMbland-eye-99092
02/13/2023, 10:45 AMsome-addition-86177
02/13/2023, 11:02 AM{}
And I am trying to add key key
with value value
, I assume I should be using the following request body for the PATCH endpoint:
[{"op": "add", "value": "value", "path": "/metadata_admin/key"}]
Can you please confirm this is correct?some-addition-86177
02/13/2023, 11:03 AM{
"error": {
"code": 400,
"status": "Bad Request",
"reason": "add operation does not apply: doc is missing path: \"/metadata_admin/key\": missing value",
"message": "The request was malformed or contained invalid parameters"
}
}
some-addition-86177
02/13/2023, 11:07 AM[{"op": "replace", "value": {"key":"value"}, "path": "/metadata_admin"}]
Which was even worse cause it returned a 200 but the end result was actually metadata_admin
being set to nullbland-eye-99092
02/13/2023, 11:08 AMWhich was even worse cause it returned a 200 but the end result was actuallyYes, that is worse… And we should fix that.being set to nullmetadata_admin
some-addition-86177
02/13/2023, 11:11 AMbland-eye-99092
02/13/2023, 11:11 AMmagnificent-energy-493
bland-eye-99092
02/13/2023, 11:22 AMbland-eye-99092
02/13/2023, 11:23 AMnull
issue, I am not sure, what causes that… But seems at least similar in nature.some-addition-86177
02/13/2023, 11:34 AMPUT /admin/identity/<id>
endpoint which expects a full update (all traits, all metadata, etc.)
• the PATCH /admin/identity/<id>
endpoint which does partial updates (e.g. adding a single key to the metadata)
The latter was introduced recently (in 0.11.0 if I am not mistaking). Previously I used the PUT endpoint simply because the PATCH didn’t exist yet. This was working fine (as you said) but it was cumbersome for partial updates because you need to do write-after-read and from what I saw there was no optimistic locking support to ensure there weren’t any writes in-between the read and write. That’s why I was very excited to see partial updates being added (i.e. the PATCH endpoint) and decided to switch to that. However, for some reason it doesn’t work as expected from a JSON Patch perspective for metadata_admin
(metadata_public
seems to be fine). Will add all the test cases I’ve tried in the issue descriptionsome-addition-86177
02/13/2023, 11:35 AMnil
case. I’ve seen the same problems even if other keys already exist. Will add the test case for that toosome-addition-86177
02/13/2023, 5:57 PMsome-addition-86177
02/14/2023, 9:16 AMbland-eye-99092
02/14/2023, 9:17 AMsome-addition-86177
02/14/2023, 8:09 PM