Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting A Single Json ArrayList Element To Java ArrayList

Abraham NkomoJun 15 2016 — edited Jun 24 2016

lm using JSONBeanSerializationHelper  to convert Json String into Java Class .The Json String to be converted returns Array List Element which works fine only if Array List Elements are more than one .The problem is that  If there is single Element the Json String is not converted to Java ArrayList .How Can l resolve this ...Below is the Json String returned after invoking REST service ......

"{"Response":{"MESSAGE":{"MESSAGETEXT":"User ID or Password is not Correct","MESSAGETYPE":"error"}}}"

The field MESSAGE represent Array List .  Is there a way of presenting the above Json String something like :

"{"Response":{"MESSAGE":[{"MESSAGETEXT":"User ID or Password is not Correct","MESSAGETYPE":"error"}]}}"

lm Using JDeveloper Studio Edition Version 12.2.1.0.0

This post has been answered by Abraham Nkomo on Jun 24 2016
Jump to Answer
Comments
Post Details
Added on Jun 15 2016
3 comments
992 views