Hi All,
I want to parse the JSON string which haven't root element. When I google I
found there is a configurations to dropRootElement. This is work for me for
the output json. But it didn't work for the input json. How can I solve
this problem. Here I attach my sample JSON file.
{
"ref": "refs/heads/master",
"after": "a6abbdeaf4b7b29b646501583d408f16a033a975",
"before": "244d9eeeb5de42ed078bc469d82a99106de28d87",
"created": false,
"deleted": false,
"forced": false,
"compare":
"https://github.com/manulachathurika/stratos2-test/compare/244d9eeeb5de...a6abbdeaf4b7",
"commits": [
{
"id": "a6abbdeaf4b7b29b646501583d408f16a033a975",
"distinct": true,
"message": "Test",
"timestamp": "2014-03-12T14:04:31+05:30",
"url":
"https://github.com/manulachathurika/stratos2-test/commit/a6abbdeaf4b7b29b646501583d408f16a033a975",
"author": {
"name": "Manula Thantriwatte",
"email": "[email protected]",
"username": "manulachathurika"
},
"committer": {
"name": "Manula Thantriwatte",
"email": "[email protected]",
"username": "manulachathurika"
},
"added": [
],
"removed": [
],
"modified": [
"www/sleep.php"
]
}
],
"head_commit": {
"id": "a6abbdeaf4b7b29b646501583d408f16a033a975",
"distinct": true,
"message": "Test",
"timestamp": "2014-03-12T14:04:31+05:30",
"url":
"https://github.com/manulachathurika/stratos2-test/commit/a6abbdeaf4b7b29b646501583d408f16a033a975",
"author": {
"name": "Manula Thantriwatte",
"email": "[email protected]",
"username": "manulachathurika"
},
"committer": {
"name": "Manula Thantriwatte",
"email": "[email protected]",
"username": "manulachathurika"
},
"added": [
],
"removed": [
],
"modified": [
"www/sleep.php"
]
},
"repository": {
"id": 17658115,
"name": "stratos2-test",
"url": "https://github.com/manulachathurika/stratos2-test",
"description": "Stratos2 Test",
"watchers": 0,
"stargazers": 0,
"forks": 0,
"fork": true,
"size": 112,
"owner": {
"name": "manulachathurika",
"email": "[email protected]"
},
"private": false,
"open_issues": 0,
"has_issues": false,
"has_downloads": true,
"has_wiki": true,
"language": "PHP",
"created_at": 1394607356,
"pushed_at": 1394613293,
"master_branch": "master"
},
"pusher": {
"name": "manulachathurika",
"email": "[email protected]"
}}
I want to get the repository details. In this JSON there isn't root
element. I need to know how to get repository details in this JSON
file.
Thanks !
--
Regards,
Manula Thantriwatte.