as_json_patch
Generate a verified RFC 6902 JSON Patch that transforms one document into another, preserving keyed list item identity with remove/add/move operations.
Instructions
Generate an RFC 6902 JSON Patch that transforms document a into document b.
The patch is verified before it is returned: it is applied to a and the result is re-diffed against b (using the same options), so a patch that does not reproduce b is never returned. Lists are patched with remove/add/move so keyed items keep their identity. With ignore or tolerance options the patched a equals b only up to those options. NaN/Infinity cannot be expressed in JSON and are rejected.
Args: a, b: file paths, or the documents themselves when inputs='text'. inputs: 'files' (default) or 'text'; text requires an explicit format. format, array_match, array_keys, ignore, abs_tol, rel_tol, strip_comments, encoding: as in diff_files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes | ||
| format | No | auto | |
| ignore | No | ||
| inputs | No | files | |
| abs_tol | No | ||
| rel_tol | No | ||
| encoding | No | auto | |
| array_keys | No | ||
| array_match | No | auto | |
| strip_comments | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||