News for hackers. Stuff that matters.
Re:What Is JSON Patch? by HWR_14 on Tuesday May 10, 2022 @10:40AM (#31327683)
To delete something, I imagine you set it to undefined. I don't know anyone who uses the undefined state at rest for anything interesting.
Re:What Is JSON Patch? by anentropic on Tuesday May 10, 2022 @11:03AM (#31327964)
JSON doesn't have undefined, only null

the partial updates approach works ok for updating 'schemaful' data, where it could only ever mean to set the field to null and could never delete the field from the object altogether

but for editing a JSON document or other schemaless data then both operations are possible and you'd need to be able to distinguish them