Comment

Comment by rendall

> Why not just send partial fields...?

You have:

  {
    "baz": "qux",
    "foo": "bar"
  }
Then you send the patch:

  {
    "baz": "boo"
  }
It's clear you want to change baz value to boo, but did you mean to delete foo or just ignore it? If "ignore", how do you indicate delete? If "delete", you will now have to send the entire JSON every time, anyway, so it's not a patch. Whatever your answers, there, it's not a "why not just..." situation.

You have a deeply nested property in a gigantic JSON document that you want to move, "why not just" send

  { "op": "move", "from": "/a/b/c/d", "path": "/a/b/c/e/f" }
To be clear, I have never seen JSON Patch before, either.
parent rendall 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton