given the following code:
import json
foo = '{"root":"cfb-score","children":{"gamecode":{"attribute":"global-id"},"gamestate":{"attribute":"status-id","attribute":"status","attribute":"quarter","attribute":"minutes","attribute":"seconds","attribute":"team-possession-id","attribute":"yards-from-goal","attribute":"down","attribute":"distance","attribute":"segment-number","attribute":"active-state"},"gametype":{"attribute":"type","attribute":"detail"},"stadium":{"attribute":"name","attribute":"city","attribute":"state"},"visiting-team:team-name":{"attribute":"alias"},"visiting-team:team-code":{"attribute":"global-id"},"visiting-team:team-rank":{"attribute":"rank"}}}'bar = json.loads(foo)
print json.dumps(bar)
all the lowest level 'children' are truncated (or maybe more likely overwritten) except the last when using json.loads or json.load. Why? the json is well formed and can be validated here: http://json.parser.online.fr/
a chunk of the input:
"children" : {"gamecode" : {"attribute" : "global-id"},"gamestate" : {"attribute" : "status-id", "attribute" : "status", "attribute" : "quarter", "attribute" : "minutes", "attribute" : "seconds", "attribute" : "team-possession-id", "attribute" : "yards-from-goal", "attribute" : "down", "attribute" : "distance", "attribute" : "segment-number", "attribute" : "active-state" },
turns to this chunk of output:
"children" : {"gamecode" : {"attribute" : "global-id"},"gamestate" : {"attribute" : "active-state" },