4 ms·
Having the paths in ever operation seems needlessly verbose. If I had an object { id name, password, email, phone }
by disordinary 12y ago
Having the paths in ever operation seems needlessly verbose. If I had an object
{
id
name,
password,
email,
phone
}
And I wanted to replace the email and phone items would I need to go:
{"op": "replace", "path": "/user/0/email", "value": "new@email.address"}
{"op": "replace", "path": "/user/0/phone", "value": "+64 4 555 5555"}
If I have big objects then that is going to be allot of information to transport, something like:
{"op": "rplc", "pth": "/user/0/", "ptc":
{ "email": "new@email.address", "phone": "+64 4 555 5555"}
}
- skrebbel 12y agoWhy? A compression algorithm will remove that verbosity better than a more complex format will. Just use gzip on your HTTP and you're done.
- habitue 12y agoIt sort of depends, but it might be more human readable that way. Vs. a bunch of top level operations you have a harder time mentally applying
- disordinary 12y agoStill compressed its going to be bigger. The other thing is its going to be more efficient for the processor if we define where in the object we are going to be working rather than navigating through the object for every single change even if they are adjacent to each other.