LianjiaTech / json-diff

A tool for find difference between two json-string. Support JSON string depth comparison, support JSON array unordered comparison. (用于比较两个JSON字符串的工具,支持JSON字符串深度比较,支持无序数组比较)
MIT License
50 stars 13 forks source link

对象中包含集合对象无法比较 #3

Open hadoop835 opened 2 years ago

hadoop835 commented 2 years ago

对象中包含集合对象无法比较

wangshiyia commented 1 year ago

对象中包含集合对象无法比较 可以帮忙举个例子么?

shyding commented 2 months ago

例子: str1: { "alarms": { "errors": [], "fatals": [], "notices": [], "warnings": [] }, "code": 0, "create_on": "2024-06-15T11:12:44Z", "disable_paths": [], "disable_points": [], "dynamic_obstacle": {}, "errors": [], "fatals": [], "is_error": false, "model_md5": "825641c34f197977cdb9353c5d233300", "msg": "ok", "notices": [], "report": [ { "area_resources_occupied": [ { "area_name": "new", "avoidObs_area_occupied": { "radius": -1, "x": 0, "y": 0 }, "blocks_occupied": [], "path_occupied": [ { "end_id": "LM4", "end_percentage": 0.9358817993531157, "source_id": "LM6", "start_percentage": 0.9358817993531157 } ] } ], "basic_info": { "controller_humi": 21.621, "controller_temp": 52.986, "controller_voltage": 23.878, "current_area": [ "new" ], "current_group": "Group-01", "current_label": [], "current_map": "test_24_5_29", "dsp_version": "v1.0.6.3v5", "ip": "10.107.20.122", "model": "AMB-300XS", "robot_note": "", "version": "v3.4.6.17" }, "changes": { "maps": [], "model": true }, "chassis": { "goods_region": { "name": "", "point": [] }, "head": 0.4225, "radius": 0, "shape": 1, "tail": 0.4225, "width": 0.585 }, "connection_status": 0, "current_order": {}, "dispatchable": false, "finished_path": [], "isLoaded": false, "is_error": false, "lock_info": { "desc": "", "ip": "10.107.20.33", "locked": true, "nick_name": "DESKTOP-KAMREDC[10.107.20.33]", "port": 3416, "time_t": "1718361834", "type": 2 }, "network_delay": 13, "procBusiness": false, "rbk_report": { "DI": [ { "id": 0, "status": true }, { "id": 1, "status": true }, { "id": 2, "status": true }, { "id": 3, "status": false }, { "id": 4, "status": false }, { "id": 5, "status": true }, { "id": 6, "status": true }, { "id": 7, "status": true }, { "id": 8, "status": false }, { "id": 9, "status": false }, { "id": 10, "status": false }, { "id": 11, "status": false }, { "id": 12, "status": true }, { "id": 13, "status": true }, { "id": 14, "status": true }, { "id": 15, "status": true }, { "id": 16, "status": false }, { "id": 17, "status": false }, { "id": 18, "status": false }, { "id": 19, "status": false }, { "id": 20, "status": false }, { "id": 21, "status": false }, { "id": 22, "status": false }, { "id": 23, "status": false } ], "DO": [ { "id": 0, "status": true }, { "id": 1, "status": true }, { "id": 2, "status": false }, { "id": 3, "status": true }, { "id": 4, "status": true }, { "id": 5, "status": false }, { "id": 6, "status": false }, { "id": 7, "status": false }, { "id": 8, "status": false }, { "id": 9, "status": true }, { "id": 10, "status": false }, { "id": 11, "status": false }, { "id": 12, "status": false }, { "id": 13, "status": false }, { "id": 14, "status": true }, { "id": 15, "status": true } ], "alarms": { "errors": [], "fatals": [], "notices": [], "warnings": [] }, "angle": 1.5529, "area_ids": [], "arm_info": { "endpos": { "rx": 0, "ry": 0, "rz": 0, "w": 0, "x": 0, "y": 0, "z": 0 }, "joints": [ { "angle": 0, "current": 0, "temperature": 0, "type": "base", "velocity": 0, "voltage": 0 }, { "angle": 0, "current": 0, "temperature": 0, "type": "shoulder", "velocity": 0, "voltage": 0 }, { "angle": 0, "current": 0, "temperature": 0, "type": "elbow", "velocity": 0, "voltage": 0 }, { "angle": 0, "current": 0, "temperature": 0, "type": "wrist1", "velocity": 0, "voltage": 0 }, { "angle": 0, "current": 0, "temperature": 0, "type": "wrist2", "velocity": 0, "voltage": 0 }, { "angle": 0, "current": 0, "temperature": 0, "type": "wrist3", "velocity": 0, "voltage": 0 } ], "task_status": 0 }, "available_containers": 1, "battery_level": 0.47, "blocked": false, "brake": false, "charging": false, "confidence": 0.9155, "containers": [ { "container_name": "container", "desc": "", "goods_id": "", "has_goods": false } ], "current": -4.39, "current_map": "test_24_5_29", "current_map_md5": "d75658b1db73b1e36d9d3c395075bcf1", "current_station": "", "emergency": false, "errors": [], "fatals": [], "fork": null, "info": { "currentBlockId": "", "info": "", "objectFile": "", "require": null }, "jack": { "jack_emc": false, "jack_enable": false, "jack_error_code": 0, "jack_height": 0, "jack_isFull": false, "jack_load_times": 1, "jack_mode": false, "jack_speed": 0, "jack_state": 0 }, "last_station": "LM6", "lock_info": { "desc": "", "ip": "10.107.20.33", "locked": true, "nick_name": "DESKTOP-KAMREDC[10.107.20.33]", "port": 3416, "time_t": "1718361834", "type": 2 }, "notices": [], "odo": 82951.382, "received_on": { "data_nsec": "1718361864216", "frame_id": "", "pub_nsec": "1718361864216", "seq": "0" }, "reloc_status": 1, "requestCurrent": 0, "requestVoltage": 0, "roller": { "roller_emc": false, "roller_enable": false, "roller_error_code": 0, "roller_isFull": false, "roller_mode": false, "roller_speed": 0, "roller_state": 0 }, "soft_emc": false, "spin": 0, "steer": 0, "task_status": 4, "time": 35209799, "today_odo": 31.713, "total_containers": 1, "total_time": 2462994710, "voltage": 52.26, "vx": 0, "vy": 0, "w": 0, "warnings": [], "x": 0.7149, "y": 4.3623 }, "remaining_time": -1, "src_release": false, "undispatchable_reason": { "current_map_invalid": false, "disconnect": true, "dispatchable_status": 1, "low_battery": false, "suspended": false, "unconfirmed_reloc": false, "unlock": 1 }, "unfinished_path": [], "uuid": "AMB-01", "vehicle_id": "AMB-01" } ], "scene_md5": "26e797f2c061d9cfe2197b7c14e8b253", "upload_scene_status": 0, "warnings": [] }

str2:

{ "alarms": { "errors": [ { "code": 52101, "desc": "hu-test-1,hu-test-3, have no charge point in map.", "times": 1, "timestamp": 1718432083 }, { "code": 52103, "desc": "hu-test-1,hu-test-3, have no park point in map.", "times": 1, "timestamp": 1718432083 } ], "fatals": [], "notices": [], "warnings": [] }, "code": 0, "create_on": "2024-06-15T15:55:48Z", "disable_paths": [], "disable_points": [], "dynamic_obstacle": {}, "errors": [ { "52101": 1718432083, "desc": "hu-test-1,hu-test-3, have no charge point in map.", "times": 1 }, { "52103": 1718432083, "desc": "hu-test-1,hu-test-3, have no park point in map.", "times": 1 } ], "fatals": [], "is_error": false, "model_md5": "044fa9d422195ecc6eddb104e4b7c92f", "msg": "ok", "notices": [], "report": [ { "area_resources_occupied": [ { "area_name": "new", "avoidObs_area_occupied": { "radius": -1, "x": 0, "y": 0 }, "blocks_occupied": [], "path_occupied": [ { "end_id": "CP34", "end_percentage": 1, "source_id": "LM45", "start_percentage": 1 }, { "end_id": "LM45", "end_percentage": 0, "source_id": "CP34", "start_percentage": 0 } ] } ], "basic_info": { "controller_humi": null, "controller_temp": null, "controller_voltage": null, "current_area": [ "new" ], "current_group": "unnamed", "current_label": [], "current_map": "default", "dsp_version": null, "ip": null, "model": "AMB-150", "robot_note": null, "version": null }, "changes": {}, "chassis": { "goods_region": { "name": "", "point": [] }, "head": 0.25, "radius": 0, "shape": 1, "tail": 0.25, "width": 0.5 }, "connection_status": 1, "current_order": {}, "dispatchable": true, "finished_path": [], "isLoaded": false, "is_error": false, "lock_info": { "desc": "", "ip": "", "locked": true, "nick_name": "f2c1b882-28fc33f2-7193e747-21fd6af0", "port": 0, "time_t": "", "type": 0 }, "network_delay": null, "procBusiness": false, "rbk_report": { "DI": [], "DO": [], "alarms": { "errors": [], "fatals": [], "notices": [], "warnings": [] }, "angle": 0, "area_ids": [], "arm_info": null, "available_containers": 0, "battery_level": 1, "blocked": false, "brake": null, "charging": false, "confidence": 1, "containers": [], "current": 0, "current_map": "default", "current_map_md5": "", "current_station": "CP34", "emergency": false, "errors": [], "fatals": [], "fork": { "fork_auto_flag": true, "fork_height": 0, "fork_height_in_place": false, "fork_pressure_actual": 0, "forward_in_place": true, "forward_val": 0 }, "info": { "pickingRobotInfo": { "trays": [] } }, "jack": { "jack_emc": false, "jack_enable": false, "jack_error_code": 0, "jack_height": 0, "jack_isFull": false, "jack_mode": false, "jack_speed": 0, "jack_state": 0 }, "last_station": "", "lock_info": { "desc": "", "ip": "", "locked": true, "nick_name": "f2c1b882-28fc33f2-7193e747-21fd6af0", "port": 0, "time_t": "", "type": 0 }, "notices": [], "odo": 1028.343133, "received_on": { "data_nsec": "37687755982600", "frame_id": "", "pub_nsec": "37687755982600", "seq": "0" }, "reloc_status": 1, "requestCurrent": 0, "requestVoltage": 0, "roller": null, "soft_emc": null, "spin": null, "steer": null, "task_status": 0, "time": null, "today_odo": null, "total_containers": 0, "total_time": null, "voltage": 0, "vx": null, "vy": null, "w": null, "warnings": [], "x": 19.081, "y": -1.383 }, "remaining_time": -1, "undispatchable_reason": { "current_map_invalid": false, "disconnect": false, "dispatchable_status": 0, "low_battery": false, "suspended": false, "unconfirmed_reloc": false, "unlock": 0 }, "unfinished_path": [], "uuid": "hu-test-3", "vehicle_id": "hu-test-3" }, { "area_resources_occupied": [ { "area_name": "new", "avoidObs_area_occupied": { "radius": -1, "x": 0, "y": 0 }, "blocks_occupied": [], "path_occupied": [ { "end_id": "PP60", "end_percentage": 1, "source_id": "AP13", "start_percentage": 1 } ] } ], "basic_info": { "controller_humi": null, "controller_temp": null, "controller_voltage": null, "current_area": [ "new" ], "current_group": "unnamed", "current_label": [], "current_map": "default", "dsp_version": null, "ip": null, "model": "AMB-150", "robot_note": null, "version": null }, "changes": {}, "chassis": { "goods_region": { "name": "", "point": [] }, "head": 0.25, "radius": 0, "shape": 1, "tail": 0.25, "width": 0.5 }, "connection_status": 1, "current_order": { "additionalProperties": {}, "blocks": [ { "binArea": "", "binTask": "", "blockId": "5f374bf2-0cc3-4df7-9704-9f44e2afb1f0", "containerName": "", "goodsId": "", "location": "AP132", "manuallyFinished": false, "operation": "", "operation_args": {}, "postAction": {}, "robotMotionProfile": null, "script_args": {}, "script_name": "", "state": "FINISHED" }, { "binArea": "", "binTask": "", "blockId": "31bea128-5563-400c-8680-195f1ec43d0c", "containerName": "", "goodsId": "", "location": "PP60", "manuallyFinished": false, "operation": "", "operation_args": {}, "postAction": {}, "robotMotionProfile": null, "script_args": {}, "script_name": "", "state": "FINISHED" } ], "candidateName": "", "complete": true, "createTime": 1718436805, "error": "[]", "errors": [], "executionTimeCost": 0, "externalId": "32365068-78a6-457b-b227-a452d8605038", "finishOdo": 1265.041664, "group": "", "id": "d6f90c07-d7c8-4e23-a28c-8ab6cef996c1", "joinable": false, "keyRoute": [ "AP12" ], "label": "", "mapfPriority": 0, "msg": "", "notices": [], "orderMinScore": 0, "orderOdo": 28.84900000000016, "orderScore": 0, "prePointRedo": false, "priority": 1, "receiveTime": 1718436805, "startOdo": 1236.192664, "state": "FINISHED", "terminalTime": 1718436866, "terminateTime": 1718436866, "type": 0, "vehicle": "hu-test-1", "warnings": [] }, "dispatchable": false, "finished_path": [], "isLoaded": false, "is_error": false, "lock_info": { "desc": "", "ip": "", "locked": true, "nick_name": "f2c1b882-28fc33f2-7193e747-21fd6af0", "port": 0, "time_t": "", "type": 0 }, "network_delay": null, "procBusiness": false, "rbk_report": { "DI": [], "DO": [], "alarms": { "errors": [], "fatals": [], "notices": [], "warnings": [] }, "angle": 0, "area_ids": [], "arm_info": null, "available_containers": 0, "battery_level": 1, "blocked": false, "brake": null, "charging": false, "confidence": 1, "containers": [], "current": 0, "current_map": "default", "current_map_md5": "", "current_station": "PP60", "emergency": false, "errors": [], "fatals": [], "fork": { "fork_auto_flag": true, "fork_height": 0, "fork_height_in_place": false, "fork_pressure_actual": 0, "forward_in_place": true, "forward_val": 0 }, "info": { "pickingRobotInfo": { "trays": [] } }, "jack": { "jack_emc": false, "jack_enable": false, "jack_error_code": 0, "jack_height": 0, "jack_isFull": false, "jack_mode": false, "jack_speed": 0, "jack_state": 0 }, "last_station": "AP13", "lock_info": { "desc": "", "ip": "", "locked": true, "nick_name": "f2c1b882-28fc33f2-7193e747-21fd6af0", "port": 0, "time_t": "", "type": 0 }, "notices": [], "odo": 1265.041664, "received_on": { "data_nsec": "37687756168700", "frame_id": "", "pub_nsec": "37687756168700", "seq": "0" }, "reloc_status": 1, "requestCurrent": 0, "requestVoltage": 0, "roller": null, "soft_emc": null, "spin": null, "steer": null, "task_status": 4, "time": null, "today_odo": null, "total_containers": 0, "total_time": null, "voltage": 0, "vx": null, "vy": null, "w": null, "warnings": [], "x": 20.798, "y": -4.572 }, "remaining_time": -1, "undispatchable_reason": { "current_map_invalid": false, "disconnect": false, "dispatchable_status": 1, "low_battery": false, "suspended": false, "unconfirmed_reloc": false, "unlock": 0 }, "unfinished_path": [], "uuid": "hu-test-1", "vehicle_id": "hu-test-1" } ], "scene_md5": "946b691bc190125d30a3485e37a81bb2", "upload_scene_status": 0, "warnings": [] }

shyding commented 2 months ago

设置了 specialPath: report.uuid 不生效,