News for hackers. Stuff that matters.
Re:Unlocking the Power of JSON Patch by kukkamario on Friday October 18, 2024 @12:33PM (#41880995)
And then you'd be limited to only one change at the time and lose the benefit of making lot of changes with one request.
Re:Unlocking the Power of JSON Patch by graypegg on Friday October 18, 2024 @12:37PM (#41881038)
I do get that, just saw the "test" op, to either pass or fail the whole change as a sort of transaction. That is really neat.

But I just find that the 1 by 1 approach is easier to reason about if you're opening this up to the internet. I'd personally feel more comfortable with the security model of 1 URL + Session => 1 JSON key.

Re:Unlocking the Power of JSON Patch by vlowther on Friday October 18, 2024 @02:37PM (#41882210)
$WORK project heavily utilizes the test op to enable atomic updates to objects across multiple competing clients. It winds up working really well for that purpose.
Re:Unlocking the Power of JSON Patch by CrimsonRain on Saturday October 19, 2024 @04:55PM (#41890715)
Who generates the test op? Client? Or the server?
Re:Unlocking the Power of JSON Patch by mattmanser on Friday October 18, 2024 @02:12PM (#41881983)
I'm actually using it at the moment in my work and I'm often doing 3-4 updates per patch.

You want them to all fail or not,

One-by-one is a bit of a weird suggestion tbh. You shouldn't be reasoning that way about code.

If you are going to get a 4xx response to one of the 4 property updates you want them all to fail at once.

Just like anything else we use like SQL.

Re:Unlocking the Power of JSON Patch by kchr on Friday October 18, 2024 @04:48PM (#41883362)
Can you elaborate on how this affects the security model?