Forum Discussion

richie's avatar
richie
Community Hero
6 years ago

Assert Repeating JSON Attribute Sorted Order

Hi,   A while ago I asked for help on asserting a repeating attribute's value in a json response was sorted in ascending and descending and you guys gave me an answer - but it's problematic becau...
  • groovyguy's avatar
    6 years ago

    You can try replacing your idsFromResponse line with this one below. That being said, the sort() method appears to have issues with some of the symbols in the names you are sorting. It actually appears to put the list out of order and makes the script fail. Not sure if you're account for that or not. 

     

    def idsFromResponse = json.data.Name;