1

For a get request im getting a json response and it contain some school data.The schools should be appear by descending order for the school rating number.

Somthing looks like this.

{ "location": "Sydney", "minStudentAge": 18, "schoolType": "Business", "rating": 5,

  },
        {
     "location": "Sydney",
     "minStudentAge": 13,
     "schoolType": "Business",
     "rating": 5,

  },
        {
     "location": "Sydney",
     "minStudentAge": 16,
     "schoolType": "Business",
     "rating": 3,

  },
        {
     "location": "Sydney",
     "minStudentAge": 18,
     "schoolType": "Business",
     "rating": 1,

  },
        {
     "location": "Sydney",
     "minStudentAge": 16,
     "schoolType": "Business",
     "rating": 2,             }
      ]

So every node is having a value named "Rating" and i need to validate whether the return json contains data on correct order. Rating top (5) should be at the top of the list and rating low (1) should be at the bottom of the list.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.