-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
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
getModifiedDiff() #25
Comments
In your example second document does not seem to modify any value existing in first document, but rather adds new values. Maybe you need to use Here is [
{
"value": "",
"op": "add",
"path": "/output/0/upload"
},
{
"value": "a0vA206.mp4",
"op": "add",
"path": "/answers/0/upload"
},
{
"value": "",
"op": "add",
"path": "/answers/0/image"
},
{
"value": "a0vA207.mp4",
"op": "add",
"path": "/answers/1/upload"
},
{
"value": "",
"op": "add",
"path": "/answers/1/image"
},
{
"value": "",
"op": "add",
"path": "/answers/2/upload"
},
{
"value": "",
"op": "add",
"path": "/answers/2/image"
},
{
"value": "",
"op": "add",
"path": "/answers/3/upload"
},
{
"value": "",
"op": "add",
"path": "/answers/3/image"
},
{
"value": "",
"op": "add",
"path": "/question/0/upload"
}
] Does this help your issue? |
thanks for your answer the bolded section not exist in the one |
i've made a function to delete null values from both JSONs and then call getPatch() and it's worked now. |
Yes, and because of that these sections do not contribute to |
i'm sending those 2 json objects
{"output": [{"text": "قَلَم", "type": "text"}], "answers": [{"text": "ـم", "correct": true}, {"text": "م", "correct": false}, {"text": "ـمـ", "correct": false}, {"text": "مـ", "correct": false}], "question": [{"text": "قَلَـ....", "type": "text", "translation": ""}], "answersType": "text", "questionText": "Harfin uygun yazılışını seçiniz"}
{"questionText":"Harfin uygun yaz\u0131l\u0131\u015f\u0131n\u0131 se\u00e7iniz","question":[{"type":"text","text":"\u0642\u064e\u0644\u064e\u0640....","translation":"","upload":""}],"answersType":"text","answers":[{"text":"\u0640\u0645","correct":true,"upload":"a0vA206.mp4","image":""},{"text":"\u0645","correct":false,"upload":"a0vA207.mp4","image":""},{"text":"\u0640\u0645\u0640","correct":false,"upload":"","image":""},{"text":"\u0645\u0640","correct":false,"upload":"","image":""}],"output":[{"type":"text","text":"\u0642\u064e\u0644\u064e\u0645","upload":""}]}
and using jsonDiff with this flags
JsonDiff::REARRANGE_ARRAYS + JsonDiff::COLLECT_MODIFIED_DIFF
when i call getModifiedDiff() it showed null array even it's obvious there is a difference between 2 json
The text was updated successfully, but these errors were encountered: