4 ms·
Why would you even need a json document to modify another json document ? Could you not author a DSL to reference XPATH like structures and have operations perf
by cinbun8 14y ago
Why would you even need a json document to modify another json document ? Could you not author a DSL to reference XPATH like structures and have operations performed on them ?
Secondly I don't see what additional benefit this adds to JSON documents across various use cases (HTTP servers / parsers / persistence / etc). From an API's perspective, are parsers expected to accept this patch-document and apply them to json-documents that they already loaded ? The closest match you get to something like this in the XML world is a XSLT. Feed one XML document in and it can be converted to an XML or output of another kind. You cannot expect HTTP servers to accept these via PATCH and update documents atomically. Resource modification is not atomic in eventually consistent systems.
For those systems where an update / patch can be made atomically, updating a field on a document without replacing it makes sense. However doing it via another json document is not the way to go IMHO. Use a DSL instead.