JsonGenerator
- Issue
- JSON
- Andrew Davis
- PowerBuilder
- Monday, 11 June 2018 03:11 PM UTC
Hi, I am using the JsonGenerator and I am having trouble getting it formatted correctly with my arrays - square brackets are missing
This is what I am trying to create
{
"userId": "adsf1234",
"dueDate": "2018/02/21",
"items": [
{
"sku": "shirt",
"id": 234567,
"extras": [
{
"type": "silk",
"price": 2.00,
}
],
"notes": "",
},
{
"sku": "shirt",
"id": 234568,
"notes": "",
},
{
]
}
********* this is my code -
ll_childobect = lnv_JsonGenerator.CreateJsonObject()
lnv_JsonGenerator.AddItemString(ll_ChildObject, "userId", 'W2DBZqIkce')
lnv_JsonGenerator.AddItemString(ll_ChildObject, "dueDate", "14/06/2018")
ll_item_array=lnv_JsonGenerator.additemobject(ll_childobject,"items")
lnv_JsonGenerator.AddItemString(ll_item_array, "sku", "shirt")
lnv_JsonGenerator.AddItemString(ll_item_array, "description", 'white shirt')
********* this is what I get
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.