Forum Discussion

SK07's avatar
SK07
Contributor
7 years ago

Groovy - validate Json array

Json: "prodS": {"langTrans": [{ "Id": "11", lang="EN"}, {"Id": "11", lang="FR"},{ "Id": "12", lang="EN"}, {"Id": "12", lang="FR"}], "rates":[{"Id":"11","rate": 100},{Id":"12","rate":200}] }
Here we have 2 arrays. one is ProdS and other is rates.
I have to validate for each Id under rates array, I should find one lang 'EN' & lang'Fr' for that matching Id under langTrans array.