Bitte könnten Sie mir helfen, Array zu sortieren, das ich mit $ .. balanceChange bekomme. Es ist ein kleiner Teil der Antwort.Jsonpath Array sortieren
Ich brauche es für die Behauptung in SoapUI.
{ "id": 182, "name": "49899 Consol Sick w S&S Pattern", "eventDefinition": { "id": 111, "name": "49899 Consol Sick w S&S Pattern", "shortName": null, "displayName": "49899 Consol Sick w S&S Pattern", "active": true, "group": null, "lowerThresholdAmount": 0, "upperThresholdAmount": 0, "lowerThresholdDayAmount": null, "upperThresholdDayAmount": null, "amountUnit": null, "exceptionType": null, "comment": null, "paycode": null, "paycodeAmountType": null, "usedType": null, "punchType": null, "type": {"name": "pattern"}, "extendedData": null, "dayBased": false }, "policyDefinition": { "id": 404, "name": "49899 Consolidated Sick w S&S plc467381724319" }, "ruleDefinition": { "id": 604, "name": "WR467381724319" }, "pointTransaction": { "id": 313, "name": "Attendance Points 1", "employeeId": 385, "balanceChange": 5, "typeCategory": "POINT", "applyDate": "2016-04-28T00:00:00" }, "type": {"name": "pattern"}, "employeeId": 385, "applyDate": "2016-04-28", "eventTime": "00:00:00", "amount": null, "dayAmount": null, "updatedByUserId": 12, "isSystem": true }
Wie wollen Sie es (Id, Name oder Objekt) sortiert werden soll? Könnten Sie mehr Erklärung geben? – Anton
Wenn $ .. balanceChange ausgeführt wird, habe ich [9.0, 8.0, 9.0, 8.0, 8.0, 8.0, 6.0, 5.0]. Aber manchmal ist diese Sequenz geändert und ich kann [8.0, 9.0, 9.0, 8.0, 8.0, 8.0, 6.0, 5.0] bekommen. Ich muss dieses Array durch balanceChange –
sortieren, also ist der einfache Weg Gebrauch Unterstreichung. Siehe Antwort möglicherweise kann es Ihnen helfen, wenn nicht, werde ich versuchen, den Code neu zu schreiben, lass es mich wissen – Anton