We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This tool does not detect absolute difference between the 2 datasets.
Example:
1s.json:
{ "Key1": "1" }
2s.json:
{ "Key1": "1", "Key2": "1" }
$ python comparejson.py 2s.json 1s.json Reason: Length Mismatch: Expected Length: 2, Actual Length: 1 Expected: { "Key1": "1", "Key2": "2" } Actual: { "Key1": "1" } Missing keys: [u'Key2'] $ python comparejson.py 1s.json 2s.json $
Is this a bug or an (undocumented) feature?
In comparison, jsondiff detects difference no matter what is the order:
jsondiff
$ jsondiff 1s.json 2s.json {"Key2": "2"}% $ jsondiff 2s.json 1s.json {"$delete": ["Key2"]}%
The text was updated successfully, but these errors were encountered:
comparejson.py below:
import json, sys import jsoncompare import ast if len(sys.argv) < 3: sys.exit('Error') json1 = json.loads(open(sys.argv[1],'r').read()) json2 = json.loads(open(sys.argv[2],'r').read()) try: ignoredKeys += ast.literal_eval(sys.argv[3]) except IndexError: pass json2 = json.loads(open(sys.argv[2],'r').read()) (check,stack) = jsoncompare.are_same(json1,json2, ignore_list_order_recursively=False, ignore_missing_keys=False, ignore_value_of_keys=ignoredKeys) if not check: print(stack) sys.exit(1)
Sorry, something went wrong.
No branches or pull requests
This tool does not detect absolute difference between the 2 datasets.
Example:
1s.json:
2s.json:
Is this a bug or an (undocumented) feature?
In comparison,
jsondiff
detects difference no matter what is the order:The text was updated successfully, but these errors were encountered: