0

I have a JSONObject, how do I parse the array (registrys) and take its element 0?

{
  "extendedResponseMessages": null,
  "responseBody": {
    "data": {
      "uid": "8ytythc5-cfhghg43-4ad0-a2hgd0-8ddhghg77",
      "pay": 1000,
      "name": "alex",
      "registrys": [],
      "status": "ACTIVE"
    },
Laplas
  • 91
  • 5
  • Please give more context. If you need just a single string you can parse the json as string and find the corresponding part within it otherwise you need to convert your json document to a corresponding object using some libraries like Jackson or Gson – Maksym Kosenko Jun 14 '23 at 12:07
  • this is already an object, but it is necessary to take and pull only the zero element of the array from this object – Laplas Jun 14 '23 at 12:36
  • I meant a corresponding Java object representation, basically a class defining the same structure as the json document. More details [here](https://stackoverflow.com/questions/10308452/how-to-convert-the-following-json-string-to-java-object) – Maksym Kosenko Jun 14 '23 at 13:51

0 Answers0