How to test array of objects matches a pattern in Karate

Viewed 613

I have an array of objects like below.

"possibleValues": [
            {
                "unitGroup": "A",
                "measurementUnitResource": [
                    {
                        "unit": "1"
                    },
                    {
                        "unit": "2"
                    },
                    {
                        "unit": "3"
                    }
                 ],
                "unitGroup": "B",
                "measurementUnitResource": [
                    {
                        "unit": "7"
                    },
                    {
                        "unit": "8"
                    },
                    {
                        "unit": "9"
                    }
                 ]
            }
     ]

How to check possibleValues array contains objects of pattern {unitGroup:"#String" measurementUnitResource:[{unit:"#String"}]} in karate.

1 Answers
Related