3 ms·
I would love to see some (optional) checksumming or orignal value in the protocol and a little more flexibility in the root node for other metadata like format
by _blk 2y ago
I would love to see some (optional) checksumming or orignal value in the protocol and a little more flexibility in the root node for other metadata like format versioning etc. rather than just the array of patch ops in the root.
```
{
"checksum": {
"algorithm": "sha1",
"normalization": "minify",
"root-checksum": "d930e659007308ac8090182fe664c7f64e898ed9"
},
"patch": [
{
"op": "replace",
"path": "/id",
"node-checksum": "b11ee5e59dc833a22b5f0802deb99c29fb50fdd0",
"value": {
"foo": "bar",
"nullptr": 0
}
},
{
"op": "replace",
"path": "/cat",
"original-value": "foo"
"value": "bar"
}
]
}
```
- naberhausj 2y agoThis is what "op": "test" is for. You can use it at the beginning of a patch to verify that the server's object hasn't drifted from your own.
- _blk 2y agoGood point, thanks. Specified here: https://datatracker.ietf.org/doc/html/rfc6902#section-4.6 https://datatracker.ietf.org/doc/html/rfc6902#section-4.6 Yet, I would still like a checksum option because of its constant size impact. I didn't consider before though that checksumming would differ from json's understanding of equality if items are reordered (objects, but also some other cases like integers with explicit sign +0, 0, -0). Those cases could (optionally) be considered in a normalization step.