In growing number of JSON Patch applications, we already faced problem with operations that are not permited for specific use case, operations that should be omitted, etc.
Why don't we create a JSON Patch Schema, that will
describe your operation permissions
become clear, human- and machine-readable documentation
complete structural validation, useful for
automated testing
validating client-submitted data
For example something like
[
{op: "ignore", scope: "/name/space", path: "hiddenProperty"}, //will ignore all operations for `obj.name.space.hiddenProperty`
{op: "error", scope: "", path: "_version#", ops: ["remove"]}, //will trigger an error in case of `{op: "remove", path: "/_ver#s"}`
{op: "ignore", scope: "", path: /reg.egxp/, recursively: true} // will ignore any operation which path matches regexp, and check all objects recursively
]
There is JSON Schema:
In growing number of JSON Patch applications, we already faced problem with operations that are not permited for specific use case, operations that should be omitted, etc.
Why don't we create a JSON Patch Schema, that will
For example something like