summaryrefslogtreecommitdiff
path: root/bin/jsonpatch
Commit message (Collapse)AuthorAgeFilesLines
* Add support for preserving Unicode characters in jsonpatch CLIGenzer Hawker2021-03-031-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the JSON content contains some Unicode characters, the jsonpatch final output will encode the Unicode character using ASCII (i.e `\u0394`). This behaviour comes from the module `json.dump()` governed by a flag `ensure_ascii`[1]. For example: ```json /* patch.json */ [{ "op": "add", "path": "/SomeUnicodeSamples", "value": "𝒞𝘋𝙴𝓕ĢȞỈ𝕵 đ áê 🤩 äÄöÖüÜß" }] ``` After applying the patch on an empty source file `{}`, this is the output: ```json {"SomeUnicodeSamples": "\ud835\udc9e\ud835\ude0b...\u00fc\u00dc\u00df"} ``` This commit adds a flag `-u|--preserve-unicode` in the jsonpatch CLI to configure the behaviour of `json.dump`'s `ensure_ascii` flag. Using the `--preserve-unicode` flag, the cli will print the Unicode characters as-is without any encoding. [1]: https://docs.python.org/3/library/json.html#basic-usage
* note why we use the same directoryMatt Behrens2014-02-041-1/+2
|
* add commentary and replace tabs with spacesMatt Behrens2014-02-041-3/+33
|
* add --backup flag and attempt to address various exceptions that may be raisedMatt Behrens2014-01-141-5/+25
|
* add in-place patching and patch read from stdin. enables use ofMatt Behrens2013-12-121-4/+17
| | | | | | | | | | jsonpatch in a shell script like so: cat <<EOT | jsonpatch -i a.json [{"path": "/foo", "value": "baz", "op": "replace"}] EOT which will edit a.json in-place and leave a backup in a.json.orig.
* typoStefan Kögl2013-10-121-1/+1
|
* add "jsonpatch" commandline utilityStefan Kögl2013-10-111-0/+42