Error with json response in REST API - List Forms in Application

Error with json response in REST API - List Forms in Application

While working today on an application, i needed to fetch all the forms in my application, using the REST API - List Forms in Application to perform some functions on it, then i noticed the json format ruturned - the "display-name" was interchanged for the "component-name".
here is the response in json below:

  1. {"application-name":["chservicesalesmgt1-ide",{"formList":[{"formCount":20},{"linkid":26,"displayname":"Add_Invoice","componentname":"CheckOut","type":1},{"linkid":27,"displayname":"Add_Discount","componentname":"Add Discount","type":1},...
compared with the xml response below:

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <response>
  3. <application name = "chservicesalesmgt1-ide">
  4. <formlist>
  5. <formcount>20</formcount>
  6. <form>
  7. <displayname><![CDATA[CheckOut]]></displayname>
  8. <componentname>Add_Invoice</componentname>
  9. <linkid>26</linkid>
  10. <type>1</type>
  11. </form>
  12. <form>
  13. <displayname><![CDATA[Add Discount]]></displayname>
  14. <componentname>Add_Discount</componentname>
  15. <linkid>27</linkid>
  16. <type>1</type>
  17. </form>
  18. ...