In ION , i create JSON file... it is a flat structure
part of Script and output below:
json_file = '''{
"Dimensions": [
{
"CompanyNumber": "",
"Dimension": "",
"DimensionType": "",
"Description": "",
"Status": "",
"StatusDescription": "",
"ActionCode": ""
}
]
}
'''
json_data = json.loads(json_file)
json_data['Dimensions'][0]['CompanyNumber'] = com
json_data['Dimensions'][0]['Dimension'] = Dim
json_data['Dimensions'][0]['DimensionType'] = Dimtyp
json_data['Dimensions'][0]['Description'] = DimDesc
json_data['Dimensions'][0]['Status'] = bloc
json_data['Dimensions'][0]['StatusDescription'] = blocdesc
json_data['Dimensions'][0]['ActionCode'] = actCode
out_json = json.dumps(json_data)
{
"Dimensions": [
{
"CompanyNumber": "1030",
"Dimension": "2500",
"DimensionType": "ig",
"Description": "jhghjg",
"Status": "1",
"StatusDescription": "Free",
"ActionCode": "Add"
}
]
}
Now the expected output is below:
{
"Dimensions": [
{"CompanyNumber": "1030"
[
"Dimension": "2500",
"DimensionType": "ig",
"Description": "jhghjg",
"Status": "1",
"StatusDescription": "Free",
"ActionCode": "Add"
]
}
]
}
How can I upgrade to this output? without having to experiment multiple libraries, many of which ION may not support. Thanks