Looking through the issue and PR history it appears that the -x (--exclude-keys) option was added in Nov 2022 but when I try to use it, it is not working as expected.
Here's a simple example:
js1.json:
{ "resourceType": "SearchParameter", "version": "1", "status": "active" }
js2.json:
{ "resourceType": "SearchParameter", "version": "2", "status": "active" }
Run:
json-diff js1.json js2.json
returns diff as expected: (can't get this to show correctly in this post though)
{ \- version: "1" \+ version: "2" }
However, if I perform the same test using the -x (or --exclude-keys) option, it still reports the same diff; I would expect that it would ignore the difference for the version key property.
json-diff -x version js1.json js2.json
Is this a bug or is this not the expected behavior of the -x option?
(BTW, the -o option doesn't seem to work as expected either, if I add -o status it doesn't report that key.)
Looking through the issue and PR history it appears that the -x (--exclude-keys) option was added in Nov 2022 but when I try to use it, it is not working as expected.
Here's a simple example: js1.json:
{ "resourceType": "SearchParameter", "version": "1", "status": "active" }
js2.json:{ "resourceType": "SearchParameter", "version": "2", "status": "active" }
Run:json-diff js1.json js2.json
returns diff as expected: (can't get this to show correctly in this post though){ \- version: "1" \+ version: "2" }
However, if I perform the same test using the -x (or --exclude-keys) option, it still reports the same diff; I would expect that it would ignore the difference for the version key property.json-diff -x version js1.json js2.json
Is this a bug or is this not the expected behavior of the -x option?
(BTW, the -o option doesn't seem to work as expected either, if I add -o status it doesn't report that key.)