please do solve this quires asap....

Given source data and destination data (in json format), write a function 
which will validate whether
source data is same as destination data and highlight the differences.
Bonus: If you can validate order of data in list type values as well.

E.g. below source_data and destination data are not same (highlighted 
difference in bold )

source_data = {
"name": "Kaleigh",
"username": "Kaleigh60",
"email": "[email protected]",
"address": {
"street": "Myah Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
},
"website": "megane.biz",
"friends": [
{
"name": "Little-Reinger",
"catchPhrase": "Enhanced regional emulation"
},
{
"name": "Big-Reinger",
"catchPhrase": "emulation"
}
],
"Numbers": [
1, 2, 3, 4
]
}
destination_data = {
"name": "Kaligh",
"username": "Kaleigh60",
"email": "[email protected]",
"address": {
"street": "Gold Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
},
"website": "megane.biz",
"friends": [
{
"name": "Reinger",
"catchPhrase": "Enhanced regional emulation"
},
{
"name": "Big-Reinger",
"catchPhrase": "emulation"
}
],
"Numbers": [
4, 2, 1, 5
]
}
E.g 2. Following data are same
source_data = {
"name": "Kaleigh",
"username": "Kaleigh60",
"email": "[email protected]",
"address": {
"street": "Myah Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
}
}
destination_data = {
"name": "Kaleigh",
"address": {
"street": "Myah Course",
"suite": "Apt. 657",
"city": "Boyerberg",
"zipcode": "66413-8920",
"geo": {
"lat": "-44.6203",
"lng": "16.7454"
}
},
"username": "Kaleigh60",
"email": "[email protected]",
}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/637eb45f-05c3-4ac8-94ca-114994da1f1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to