Friday, February 11, 2022

Json - Array type element formats | Sample json payloads

Here , you can see a sample array type employee element having fname, lname and dept details.

Json format 1:

[

{"Fname":"","Lname":"","Dept": ""},

{"Fname":"","Lname":"","Dept": ""}

]

Json format 2:

{"employees":[    
{"name":"sri", "email":"sri@gmail.com", "age":23},    
 {"name":"sand", "email":"sand@gmail.com", "age":28},  
{"name":"dip", "email":"dip@gmail.com", "age":33},    
{"name":"Bob", "email":"bob32@gmail.com", "age":41}   
]}  


Json format 3: most understandable format:

{

"Employees":{

"Employee":[    
{"name":"sri", "email":"sri@gmail.com", "age":23},    
 {"name":"sand", "email":"sand@gmail.com", "age":28},  
{"name":"dip", "email":"dip@gmail.com", "age":33},    
{"name":"Bob", "email":"bob32@gmail.com", "age":41}   
]

}  

}


No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...