Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a make a arraylist in json if there is a single object inside the List?
    primarykey
    data
    text
    <p>For a single Object inside the list the webservice is formatting the json as :</p> <pre><code>{ "statusCode": "SUCCESS", "LocationData": { "userID": "85010352", "salesOrganisation": "AU10", "hospitalAccount": "0001016425", "Locations": { "locationDetails": { "consignmentFlag": "0", "itemData": { "itemDetails": [ { "additionalConsignmentComment": "null", "boQuantity": "0", "initialConsignmentComment": "null", "materialCode": "SPB1233G", "maxExpectedStockLevel": "0", "maxPAR": "null", "minPAR": "1", "newBarcode": "", "persistentItemNote": "", "shelfSequenceData": { "shelfSequenceDetails": { "countSequence": "81" } }, "totalStockQuantity": "12", "vendorCode": "USAU" }, { "additionalConsignmentComment": "null", "boQuantity": "0", "initialConsignmentComment": "null", "materialCode": "SPB5142G", "maxExpectedStockLevel": "0", "maxPAR": "null", "minPAR": "1", "newBarcode": "", "persistentItemNote": "", "shelfSequenceData": { "shelfSequenceDetails": { "countSequence": "82" } }, "totalStockQuantity": "10", "vendorCode": "USAU" }, { "additionalConsignmentComment": "null", "boQuantity": "0", "initialConsignmentComment": "null", "materialCode": "SPB5223G", "maxExpectedStockLevel": "0", "maxPAR": "null", "minPAR": "6", "newBarcode": "", "persistentItemNote": "", "shelfSequenceData": { "shelfSequenceDetails": { "countSequence": "83" } }, "totalStockQuantity": "15", "vendorCode": "USAU" }, { "additionalConsignmentComment": "null", "boQuantity": "0", "initialConsignmentComment": "null", "materialCode": "SPB5633G", "maxExpectedStockLevel": "0", "maxPAR": "null", "minPAR": "1", "newBarcode": "", "persistentItemNote": "", "shelfSequenceData": { "shelfSequenceDetails": { "countSequence": "84" } }, "totalStockQuantity": "11", "vendorCode": "USAU" } ] }, "locationAccount": "102021EYE", "locationCountDate": "2013/07/25" } } }, "ItemBarCodeData": null } </code></pre> <p>As you can see here if there is only one single location the webservice is treating the Locations field in json as a single object , where as when there is multiple data the jersey formats the field as array with "[]" square brackets in place after </p> <pre><code>"Locations": [{ "locationDetails": { } }]; </code></pre> <p>I tried to find a solution to make the location as a list for single element but was not successful.Can anyone help me on this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload