4 ms·
> Strengths: ... Idempotency: JSON Patch operations can be safely retried without causing unintended side effects. So, wait, you can't add an item to an array
by quietbritishjim 2y ago
> Strengths: ... Idempotency: JSON Patch operations can be safely retried without causing unintended side effects.
So, wait, you can't add an item to an array with this (except at a predefined position)? I.e. "add" with path "/.../myarray/~" (if I've understand their notation right) isn't allowed?
I'm not sure if that's good or bad, but it's certainly surprising and could do with saying a bit more explicitly.
- uzerfcwn 2y agoYou can add to the end of an array by using the path /.../myarray/-, i.e., the index is replaced by a dash. JSON patch is indeed not idempotent.