2

My JsonBody is

{  
   "acr_values":[  
      "AAL1",
      "AAL2"
   ],
   "poc":[  
      {  
         "attribute1":"value1"
      },
      {  
         "attribute1":"value2"
      }
   ]
}

I'm trying to fetch the attribute acr_values as Array, As I'm expecting Array with in the Json Array as [ ["AAL1","AAL2"] ] and wanted to validate it using this snippet.

Object valueForAcr_Value = JsonPath.read(AboveJson, $.acr_values);

But value is returning as JsonArray ["AAL1", "AAL2"] where I'm trying to fetch the value as Array. Because when I'm trying to fetch the values for

Object valueForAttribute = JsonPath.read(AboveJson, $.poc[*].attribute1);

I'm getting the same as Json Array as ["value1" , "value1"], how do i differentiate between valueForAcr and ValueForAttribute. Is there any way that i can get the valueForAcr as [ ["AA1","AA2"] ]

krishviews
  • 31
  • 2

0 Answers0