1
jsonArray = "[{
        "id": "12",
        "Area": "Room",
        "Type": "Small",
        "mode": "Work",
    }, {
        "id": "243",
        "Area": "Hall",
        "Type": "Large",
        "mode": "Living",
    }, {
        "id": "561",
        "Area": "Kitchen",
        "Type": "Medium",
        "mode": "Cooking",
    }
]"

JsonPath ConfigPath = new JsonPath(jsonArray);

ConfigPath.get("d.findAll {d -> d.Area=='Room' && d -> d.Type=='Small'}.id");

How do I get the value of id that matches both the conditions?

I am using com.jayway.restassured.path.json.JsonPath

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
sankardev51
  • 37
  • 1
  • 6

1 Answers1

1
List<String> m1 = js1.get("findAll { d -> d.Area=='Room' && d.Type=='Small'}.id");
        System.out.println(m1);
Arun Nair
  • 425
  • 3
  • 11
  • 2
    Please don't post only code as an answer, but include an explanation what your code does and how it solves the problem of the question. Answers with an explanation are generally of higher quality, and are more likely to attract upvotes. – Mark Rotteveel Nov 03 '19 at 08:36