The invalid JSON. The missing symbol - json

I have a JSON file with not valid structure. The error occures on the line 181 (propery "edu_data"). In VS code the description of problen is "expecting comma (json 514)". In the online JSON validator the error message is "Expecting comma or ], not colon".
I've checked the JSON manully a lot of times but can't figure out where I'd missed the symbol. So please help me to find the missing symbol.
{
"response":"success",
"description":"Ok",
"objects":[
{
"type":"hr_application",
"object":{
"appl_id":98,
"type":"hr",
"state":200,
"user_state":200,
"business_dept":"pyat",
"loader_user_name":"X5\\M.Sergeev",
"loader_comment":"",
"load_time":"2019-09-25T14:35:38.91",
"user_name":"x5\\Anna.Ivanina",
"system_comment":"Иванов Иван Сергеевич",
"pi_data":[
{
"pi_id":11111,
"pi_relation":"main",
"state":"other",
"fio_data":[
{
"is_actual":true,
"f":"Иванов",
"i":"Иван",
"o":"Сергеевич",
"norm_f":"иванов",
"norm_i":"иван",
"norm_o":"сергеевич"
}
],
"d":6,
"m":10,
"y":1978,
"citizenship":"",
"gender":"",
"b_place":"г. Обнинск",
"inn":"123456789012",
"is_enterp":false,
"is_enterp_comment":"",
"aff_with_x5":false,
"driver_data":{
"license_info":"",
"car_info":""
},
"id_document_data":[
{
"is_actual":true,
"type":"pasp",
"series":"1234",
"number":"123123",
"issuer":"УВД города Обнинска",
"issue_date":"07.03.2011",
"norm_series":"1234",
"norm_number":"123123",
"is_valid":1
}
],
"adr_data":[
{
"type":"reg",
"value":"г Обнинск, ул Ленина, д 2, кв 1",
"norm_value":" г Обнинск, ул Ленина, д 2, кв 1"
},
{
"type":"reg_tmp",
"value":"",
"norm_value":""
},
{
"type":"liv",
"value":" г Обнинск, ул Набережная, д 7, кв 1",
"norm_value":" г Обнинск, ул Набережная, д 7, кв 1"
}
],
"tel_data":[
{
"type":"mob",
"value":"79111111111",
"norm_value":"9111111111"
}
],
"email_data":[
{
"type":"pers",
"value":"IvanObninsk#gmail.com",
"norm_value":"ivanobninsk#gmail.com"
}
],
"le_data":[
{
"pi_relation":"employee",
"state":"other",
"name":"ООО Компания в которой работал кандидат",
"full_name":"",
"legal_form":"",
"inn":"",
"ogrn":"",
"kpp":"",
"okpo":"",
"okonh":"",
"reg_date":"",
"reg_place":"",
"okved_data":[
{
"value":"Услуги"
}
],
"tel_data":[
{
"type":"mob",
"value":"",
"norm_value":""
}
],
"email_data":[
],
"adr_data":[
{
"type":"leg",
"value":"г Москва пр. Коммунистический 34",
"norm_value":" г Москва пр. Коммунистический 34"
}
],
"pi_position":"инженер",
"pi_respons":"",
"pi_start_date":"01.2012",
"pi_end_date":"05.2016",
"pi_man_info":"",
"pi_quit_reas":"смена работы",
"pi_ach_info":"",
"pi_is_last":true
},
{
"pi_relation":"employee",
"state":"other",
"name":"ООО Компания 23",
"full_name":"",
"legal_form":"",
"inn":"",
"ogrn":"",
"kpp":"",
"okpo":"",
"okonh":"",
"reg_date":"",
"reg_place":"",
"okved_data":[
{
"value":"торговля"
}
],
"tel_data":[
{
"type":"mob",
"value":"",
"norm_value":""
}
],
"email_data":[
],
"adr_data":[
{
"type":"leg",
"value":"",
"norm_value":""
}
],
"pi_position":"риэлтор",
"pi_respons":"",
"pi_start_date":"07.2016",
"pi_end_date":"07.2019",
"pi_man_info":"",
"pi_quit_reas":"маленькая зп",
"pi_ach_info":"",
"pi_is_last":false
},
"edu_data":[
{
"type":"main",
"name":"Институт г Обнинск ",
"speciality":"Менеджер",
"start_year":"2006",
"end_year":"2011"
}
],
"prosp_dept":"Перекресток Офис",
"prosp_position":"менеджер по аренде",
"prosp_comment":"",
"prosp_vac_inf_src":"",
"res_data":[
{
"id":123456,
"hr_appl_id":123123,
"pi_id":11111,
"res_user_name":"X5\\Anna.Ivanina ",
"res":-1,
"comment":"Комментарии аналитика 1",
"inner_comment":"Внутренний комментарий 1",
"create_time":"2019-09-26T10:44:26.353",
"res_code_data":[
""
],
"res_text_data":[
]
},
{
"id":123458,
"hr_appl_id":123123,
"pi_id":11111,
"res_user_name":"X5\\Ivanov ",
"res":-1,
"comment":"Комментарии аналитика 2",
"inner_comment":"Внутренний комментарий 2",
"create_time":"2019-09-27T11:04:26.353",
"res_code_data":[
],
"res_text_data":[
]
}
],
"appr_data":[
{
"id":98766,
"hr_appl_id":123123,
"pi_id":11111,
"init_user_name":"X5\\Igor.Sergeev",
"dest_email":"Am.Soglasuushaya#x5.ru",
"dest_comment":"",
"email_message_id":0,
"res":1,
"comment":" ",
"create_time":"2019-09-26T10:15:35.833",
"update_time":"2019-09-26T12:50:40.567",
"url":"65565GGHJUGFHF8FJF8EOE0RURKF8EL",
"security_manager_appr_data":[
{
"id":1234,
"hr_appl_id":123123,
"pi_id":11111,
"pi_appr_id":98766,
"security_manager_user_namee":"x5\\Alek.Fedrenko",
"security_manager_res":1,
"create_time":"2019-09-26T10:15:35.883",
"update_time":"2019-09-26T10:21:59.293"
}
]
},
{
"id":98564,
"hr_appl_id":123123,
"pi_id":11111,
"init_user_name":"X5\\Vlad.Petrov ",
"dest_email":"M.Disapprovov#x5.ru",
"dest_comment":"",
"email_message_id":0,
"res":0,
"comment":" ",
"create_time":"2019-09-26T10:15:04.567",
"update_time":"2019-09-26T10:15:04.567",
"url":"DHDHDHD5D6DHD7D7DD7D7D9DKD9DDLSDKF9F9994F",
"security_manager_appr_data":[
{
"id":123451,
"hr_appl_id":123123,
"pi_id":11111,
"pi_appr_id":98564,
"security_manager_user_namee":"x5\\Petr.Andreev ",
"security_manager_res":0,
"create_time":"2019-03-11T10:15:04.583",
"update_time":"2019-03-11T10:15:04.583"
}
]
}
],
"chk_stage":"checked_pos",
"appr_allowed":false,
"res_allowed":true,
"email_message_data":[
],
"aux_info":""
},
{
"pi_id":11111,
"pi_relation":"mother",
"state":"other",
"fio_data":[
{
"is_actual":true,
"f":"Иванова",
"i":"Галина",
"o":"Петровна",
"norm_f":"лыкова",
"norm_i":"галина",
"norm_o":"сергеевна"
}
],
"d":30,
"m":11,
"y":1958,
"citizenship":"",
"gender":"",
"b_place":"",
"inn":"",
"is_enterp":false,
"is_enterp_comment":"",
"aff_with_x5":false,
"driver_data":{
"license_info":"",
"car_info":""
},
"id_document_data":[
],
"adr_data":[
{
"type":"liv",
"value":"",
"norm_value":""
}
],
"tel_data":[
],
"email_data":[
],
"le_data":[
{
"pi_relation":"employee",
"state":"other",
"name":"Пенсионер",
"full_name":"",
"legal_form":"",
"inn":"",
"ogrn":"",
"kpp":"",
"okpo":"",
"okonh":"",
"reg_date":"",
"reg_place":"",
"okved_data":[
],
"tel_data":[
],
"email_data":[
],
"adr_data":[
],
"pi_position":"",
"pi_respons":"",
"pi_start_date":"",
"pi_end_date":"",
"pi_man_info":"",
"pi_quit_reas":"",
"pi_ach_info":"",
"pi_is_last":false
}
],
"edu_data":[
],
"prosp_dept":"",
"prosp_position":"",
"prosp_comment":"",
"prosp_vac_inf_src":"",
"res_data":[
],
"appr_data":[
],
"chk_stage":"ready",
"appr_allowed":false,
"res_allowed":false,
"email_message_data":[
],
"aux_info":""
},
"file_data":[
],
"is_manual":false,
"is_postponed":false
}
}
]
}

Here is your Valid JSON, it was the array symbol creating the issue. Array closing was missing before edu_data key.
{
"response": "success",
"description": "Ok",
"objects": [{
"type": "hr_application",
"object": {
"appl_id": 98,
"type": "hr",
"state": 200,
"user_state": 200,
"business_dept": "pyat",
"loader_user_name": "X5\\M.Sergeev",
"loader_comment": "",
"load_time": "2019-09-25T14:35:38.91",
"user_name": "x5\\Anna.Ivanina",
"system_comment": "Иванов Иван Сергеевич",
"pi_data": [{
"pi_id": 11111,
"pi_relation": "main",
"state": "other",
"fio_data": [{
"is_actual": true,
"f": "Иванов",
"i": "Иван",
"o": "Сергеевич",
"norm_f": "иванов",
"norm_i": "иван",
"norm_o": "сергеевич"
}],
"d": 6,
"m": 10,
"y": 1978,
"citizenship": "",
"gender": "",
"b_place": "г. Обнинск",
"inn": "123456789012",
"is_enterp": false,
"is_enterp_comment": "",
"aff_with_x5": false,
"driver_data": {
"license_info": "",
"car_info": ""
},
"id_document_data": [{
"is_actual": true,
"type": "pasp",
"series": "1234",
"number": "123123",
"issuer": "УВД города Обнинска",
"issue_date": "07.03.2011",
"norm_series": "1234",
"norm_number": "123123",
"is_valid": 1
}],
"adr_data": [{
"type": "reg",
"value": "г Обнинск, ул Ленина, д 2, кв 1",
"norm_value": " г Обнинск, ул Ленина, д 2, кв 1"
},
{
"type": "reg_tmp",
"value": "",
"norm_value": ""
},
{
"type": "liv",
"value": " г Обнинск, ул Набережная, д 7, кв 1",
"norm_value": " г Обнинск, ул Набережная, д 7, кв 1"
}
],
"tel_data": [{
"type": "mob",
"value": "79111111111",
"norm_value": "9111111111"
}],
"email_data": [{
"type": "pers",
"value": "IvanObninsk#gmail.com",
"norm_value": "ivanobninsk#gmail.com"
}],
"le_data": [{
"pi_relation": "employee",
"state": "other",
"name": "ООО Компания в которой работал кандидат",
"full_name": "",
"legal_form": "",
"inn": "",
"ogrn": "",
"kpp": "",
"okpo": "",
"okonh": "",
"reg_date": "",
"reg_place": "",
"okved_data": [{
"value": "Услуги"
}],
"tel_data": [{
"type": "mob",
"value": "",
"norm_value": ""
}],
"email_data": [
],
"adr_data": [{
"type": "leg",
"value": "г Москва пр. Коммунистический 34",
"norm_value": " г Москва пр. Коммунистический 34"
}],
"pi_position": "инженер",
"pi_respons": "",
"pi_start_date": "01.2012",
"pi_end_date": "05.2016",
"pi_man_info": "",
"pi_quit_reas": "смена работы",
"pi_ach_info": "",
"pi_is_last": true
},
{
"pi_relation": "employee",
"state": "other",
"name": "ООО Компания 23",
"full_name": "",
"legal_form": "",
"inn": "",
"ogrn": "",
"kpp": "",
"okpo": "",
"okonh": "",
"reg_date": "",
"reg_place": "",
"okved_data": [{
"value": "торговля"
}],
"tel_data": [{
"type": "mob",
"value": "",
"norm_value": ""
}],
"email_data": [
],
"adr_data": [{
"type": "leg",
"value": "",
"norm_value": ""
}],
"pi_position": "риэлтор",
"pi_respons": "",
"pi_start_date": "07.2016",
"pi_end_date": "07.2019",
"pi_man_info": "",
"pi_quit_reas": "маленькая зп",
"pi_ach_info": "",
"pi_is_last": false
}
],
"edu_data": [{
"type": "main",
"name": "Институт г Обнинск ",
"speciality": "Менеджер",
"start_year": "2006",
"end_year": "2011"
}],
"prosp_dept": "Перекресток Офис",
"prosp_position": "менеджер по аренде",
"prosp_comment": "",
"prosp_vac_inf_src": "",
"res_data": [{
"id": 123456,
"hr_appl_id": 123123,
"pi_id": 11111,
"res_user_name": "X5\\Anna.Ivanina ",
"res": -1,
"comment": "Комментарии аналитика 1",
"inner_comment": "Внутренний комментарий 1",
"create_time": "2019-09-26T10:44:26.353",
"res_code_data": [
""
],
"res_text_data": [
]
},
{
"id": 123458,
"hr_appl_id": 123123,
"pi_id": 11111,
"res_user_name": "X5\\Ivanov ",
"res": -1,
"comment": "Комментарии аналитика 2",
"inner_comment": "Внутренний комментарий 2",
"create_time": "2019-09-27T11:04:26.353",
"res_code_data": [
],
"res_text_data": [
]
}
],
"appr_data": [{
"id": 98766,
"hr_appl_id": 123123,
"pi_id": 11111,
"init_user_name": "X5\\Igor.Sergeev",
"dest_email": "Am.Soglasuushaya#x5.ru",
"dest_comment": "",
"email_message_id": 0,
"res": 1,
"comment": " ",
"create_time": "2019-09-26T10:15:35.833",
"update_time": "2019-09-26T12:50:40.567",
"url": "65565GGHJUGFHF8FJF8EOE0RURKF8EL",
"security_manager_appr_data": [{
"id": 1234,
"hr_appl_id": 123123,
"pi_id": 11111,
"pi_appr_id": 98766,
"security_manager_user_namee": "x5\\Alek.Fedrenko",
"security_manager_res": 1,
"create_time": "2019-09-26T10:15:35.883",
"update_time": "2019-09-26T10:21:59.293"
}]
},
{
"id": 98564,
"hr_appl_id": 123123,
"pi_id": 11111,
"init_user_name": "X5\\Vlad.Petrov ",
"dest_email": "M.Disapprovov#x5.ru",
"dest_comment": "",
"email_message_id": 0,
"res": 0,
"comment": " ",
"create_time": "2019-09-26T10:15:04.567",
"update_time": "2019-09-26T10:15:04.567",
"url": "DHDHDHD5D6DHD7D7DD7D7D9DKD9DDLSDKF9F9994F",
"security_manager_appr_data": [{
"id": 123451,
"hr_appl_id": 123123,
"pi_id": 11111,
"pi_appr_id": 98564,
"security_manager_user_namee": "x5\\Petr.Andreev ",
"security_manager_res": 0,
"create_time": "2019-03-11T10:15:04.583",
"update_time": "2019-03-11T10:15:04.583"
}]
}
],
"chk_stage": "checked_pos",
"appr_allowed": false,
"res_allowed": true,
"email_message_data": [
],
"aux_info": ""
},
{
"pi_id": 11111,
"pi_relation": "mother",
"state": "other",
"fio_data": [{
"is_actual": true,
"f": "Иванова",
"i": "Галина",
"o": "Петровна",
"norm_f": "лыкова",
"norm_i": "галина",
"norm_o": "сергеевна"
}],
"d": 30,
"m": 11,
"y": 1958,
"citizenship": "",
"gender": "",
"b_place": "",
"inn": "",
"is_enterp": false,
"is_enterp_comment": "",
"aff_with_x5": false,
"driver_data": {
"license_info": "",
"car_info": ""
},
"id_document_data": [
],
"adr_data": [{
"type": "liv",
"value": "",
"norm_value": ""
}],
"tel_data": [
],
"email_data": [
],
"le_data": [{
"pi_relation": "employee",
"state": "other",
"name": "Пенсионер",
"full_name": "",
"legal_form": "",
"inn": "",
"ogrn": "",
"kpp": "",
"okpo": "",
"okonh": "",
"reg_date": "",
"reg_place": "",
"okved_data": [
],
"tel_data": [
],
"email_data": [
],
"adr_data": [
],
"pi_position": "",
"pi_respons": "",
"pi_start_date": "",
"pi_end_date": "",
"pi_man_info": "",
"pi_quit_reas": "",
"pi_ach_info": "",
"pi_is_last": false
}],
"edu_data": [
],
"prosp_dept": "",
"prosp_position": "",
"prosp_comment": "",
"prosp_vac_inf_src": "",
"res_data": [
],
"appr_data": [
],
"chk_stage": "ready",
"appr_allowed": false,
"res_allowed": false,
"email_message_data": [
],
"aux_info": ""
}
],
"file_data": [
],
"is_manual": false,
"is_postponed": false
}
}]
}

Related

How to group flight segments/legs in Bargain Finder Max?

I am trying to search for flights between two places in Sabre using BargainFindermax API. The API provides me with a list of all flights. However, there is no direct relation to which of the flights are linked.
For example, I searched for flights between BLR > LCY. The response I got included flights for AMS > LCY, BLR > DEL, BLR > DEL, DEL > AMS, AMS > LCY.
From this, I can construct the following route BLR > DEL > AMS > LCY. But there are two flights for BLR > DEL and AMS > LCY.
How can I identify which of these flights are related?
Here is the complete JSON response,
{
"groupedItineraryResponse": {
"version": "5.2.0",
"messages": [
{
"severity": "Info",
"type": "WORKERTHREAD",
"code": "TRANSACTIONID",
"text": "2074398531853061390"
},
{
"severity": "Info",
"type": "SERVER",
"code": "ASE032LPSCIL9UM.IDM.SGDCCERT.SABRE.COM",
"text": "27036"
},
{
"severity": "Info",
"type": "DRE",
"code": "RULEID",
"text": "17203"
},
{
"severity": "Info",
"type": "DEFAULT",
"code": "RULEID",
"text": "25238"
}
],
"statistics": {
"itineraryCount": 2
},
"scheduleDescs": [
{
"id": 1,
"frequency": "*MTWTFS",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 257,
"departure": {
"airport": "AMS",
"city": "AMS",
"country": "NL",
"time": "08:45:00+02:00"
},
"arrival": {
"airport": "LCY",
"city": "LON",
"country": "GB",
"time": "08:50:00+01:00"
},
"carrier": {
"marketing": "KL",
"marketingFlightNumber": 985,
"operating": "KL",
"operatingFlightNumber": 985,
"codeShared": "/KLM CITYHOPPER",
"equipment": {
"code": "E90",
"typeForFirstLeg": "N",
"typeForLastLeg": "N"
}
}
},
{
"id": 2,
"trafficRestriction": "G",
"frequency": "SMTWTFS",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 1058,
"departure": {
"airport": "BLR",
"city": "BLR",
"country": "IN",
"time": "19:50:00+05:30"
},
"arrival": {
"airport": "DEL",
"city": "DEL",
"country": "IN",
"time": "22:50:00+05:30",
"terminal": "3"
},
"carrier": {
"marketing": "KL",
"marketingFlightNumber": 3798,
"operating": "9W",
"operatingFlightNumber": 812,
"disclosure": "9W",
"equipment": {
"code": "73H",
"typeForFirstLeg": "N",
"typeForLastLeg": "N"
}
}
},
{
"id": 3,
"trafficRestriction": "G",
"frequency": "SMTWTFS",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 1058,
"departure": {
"airport": "BLR",
"city": "BLR",
"country": "IN",
"time": "18:55:00+05:30"
},
"arrival": {
"airport": "DEL",
"city": "DEL",
"country": "IN",
"time": "22:00:00+05:30",
"terminal": "3"
},
"carrier": {
"marketing": "KL",
"marketingFlightNumber": 3703,
"operating": "9W",
"operatingFlightNumber": 833,
"disclosure": "9W",
"equipment": {
"code": "738",
"typeForFirstLeg": "N",
"typeForLastLeg": "N"
}
}
},
{
"id": 4,
"frequency": "*M**T**",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 3961,
"departure": {
"airport": "DEL",
"city": "DEL",
"country": "IN",
"time": "02:10:00+05:30",
"terminal": "3"
},
"arrival": {
"airport": "AMS",
"city": "AMS",
"country": "NL",
"time": "07:40:00+02:00"
},
"carrier": {
"marketing": "KL",
"marketingFlightNumber": 3817,
"operating": "9W",
"operatingFlightNumber": 234,
"disclosure": "9W",
"equipment": {
"code": "333",
"typeForFirstLeg": "W",
"typeForLastLeg": "W"
}
}
},
{
"id": 5,
"frequency": "*MTWTFS",
"stopCount": 0,
"eTicketable": true,
"totalMilesFlown": 257,
"departure": {
"airport": "AMS",
"city": "AMS",
"country": "NL",
"time": "09:25:00+02:00"
},
"arrival": {
"airport": "LCY",
"city": "LON",
"country": "GB",
"time": "09:30:00+01:00"
},
"carrier": {
"marketing": "KL",
"marketingFlightNumber": 987,
"operating": "KL",
"operatingFlightNumber": 987,
"codeShared": "/KLM CITYHOPPER",
"equipment": {
"code": "E90",
"typeForFirstLeg": "N",
"typeForLastLeg": "N"
}
}
}
],
"taxDescs": [
{
"id": 1,
"code": "YRI",
"amount": 160,
"currency": "USD",
"description": "SERVICE FEE - CARRIER-IMPOSED MISC",
"publishedAmount": 160,
"publishedCurrency": "USD",
"station": "DEL"
},
{
"id": 2,
"code": "YQI",
"amount": 13.3,
"currency": "USD",
"description": "SERVICE FEE - INSURANCE",
"publishedAmount": 925,
"publishedCurrency": "INR",
"station": "BLR"
},
{
"id": 3,
"code": "WO",
"amount": 3.8,
"currency": "USD",
"description": "PASSENGER SERVICE FEE",
"publishedAmount": 3.8,
"publishedCurrency": "USD",
"station": "BLR",
"country": "IN"
},
{
"id": 4,
"code": "K38",
"amount": 11.5,
"currency": "USD",
"description": "GOODS AND SERVICE TAX INTERIM DOMESTIC AND INTERNATIONAL",
"publishedAmount": 799,
"publishedCurrency": "INR",
"station": "BLR",
"country": "IN"
},
{
"id": 5,
"code": "CJ",
"amount": 7.4,
"currency": "USD",
"description": "SECURITY SERVICE CHARGE",
"publishedAmount": 6.5,
"publishedCurrency": "EUR",
"station": "AMS",
"country": "NL"
},
{
"id": 6,
"code": "RN",
"amount": 7.3,
"currency": "USD",
"description": "PASSENGER SERVICE CHARGE",
"publishedAmount": 6.4,
"publishedCurrency": "EUR",
"station": "AMS",
"country": "NL"
},
{
"id": 7,
"code": "IN",
"amount": 5.2,
"currency": "USD",
"description": "USER DEVELOPMENT FEE DEPARTURES",
"publishedAmount": 362,
"publishedCurrency": "INR",
"station": "BLR",
"country": "IN"
}
],
"taxSummaryDescs": [
{
"id": 1,
"code": "YRI",
"amount": 160,
"currency": "USD",
"description": "SERVICE FEE - CARRIER-IMPOSED MISC",
"publishedAmount": 160,
"publishedCurrency": "USD",
"station": "DEL"
},
{
"id": 2,
"code": "YQI",
"amount": 13.3,
"currency": "USD",
"description": "SERVICE FEE - INSURANCE",
"publishedAmount": 925,
"publishedCurrency": "INR",
"station": "BLR"
},
{
"id": 3,
"code": "WO",
"amount": 3.8,
"currency": "USD",
"description": "PASSENGER SERVICE FEE",
"publishedAmount": 3.8,
"publishedCurrency": "USD",
"station": "BLR",
"country": "IN"
},
{
"id": 4,
"code": "K38",
"amount": 11.5,
"currency": "USD",
"description": "GOODS AND SERVICE TAX INTERIM DOMESTIC AND INTERNATIONAL",
"publishedAmount": 0.05,
"publishedCurrency": "INR",
"station": "BLR",
"country": "IN"
},
{
"id": 5,
"code": "CJ",
"amount": 7.4,
"currency": "USD",
"description": "SECURITY SERVICE CHARGE",
"publishedAmount": 6.5,
"publishedCurrency": "EUR",
"station": "AMS",
"country": "NL"
},
{
"id": 6,
"code": "RN",
"amount": 7.3,
"currency": "USD",
"description": "PASSENGER SERVICE CHARGE",
"publishedAmount": 6.4,
"publishedCurrency": "EUR",
"station": "AMS",
"country": "NL"
},
{
"id": 7,
"code": "IN",
"amount": 5.2,
"currency": "USD",
"description": "USER DEVELOPMENT FEE DEPARTURES",
"publishedAmount": 362,
"publishedCurrency": "INR",
"station": "BLR",
"country": "IN"
}
],
"fareComponentDescs": [
{
"id": 1,
"governingCarrier": "KL",
"fareAmount": 24.65,
"fareCurrency": "INR",
"fareBasisCode": "XPLWIA",
"farePassengerType": "ADT",
"publishedFareAmount": 1717,
"oneWayFare": true,
"directionality": "FROM",
"direction": "EH",
"notValidBefore": "2019-07-21",
"notValidAfter": "2019-07-21",
"applicablePricingCategories": "4 5 6 7 8 10 12 16 18",
"vendorCode": "ATP",
"fareTypeBitmap": "00",
"fareType": "PRU",
"fareTariff": "4",
"fareRule": "INPL",
"segments": [
{
"segment": {
"surcharges": [
{
"amount": 28.71,
"currency": "NUC",
"description": "MISCELLANEOUS/OTHER",
"type": "Q"
}
]
}
},
{
"segment": {}
},
{
"segment": {}
}
]
}
],
"validatingCarrierDescs": [
{
"id": 1,
"settlementMethod": "ARC",
"newVcxProcess": true,
"default": {
"code": "DL"
}
}
],
"baggageAllowanceDescs": [
{
"id": 1,
"pieceCount": 1
}
],
"legDescs": [
{
"id": 1,
"schedules": [
{
"ref": 2
},
{
"ref": 4,
"departureDateAdjustment": 1
},
{
"ref": 5,
"departureDateAdjustment": 1
}
]
},
{
"id": 2,
"schedules": [
{
"ref": 3
},
{
"ref": 4,
"departureDateAdjustment": 1
},
{
"ref": 1,
"departureDateAdjustment": 1
}
]
}
],
"itineraryGroups": [
{
"groupDescription": {
"legDescriptions": [
{
"departureDate": "2019-07-21",
"departureLocation": "BLR",
"arrivalLocation": "LCY"
}
]
},
"itineraries": [
{
"id": 1,
"pricingSource": "ADVJR1",
"legs": [
{
"ref": 2
}
],
"pricingInformation": [
{
"pricingSubsource": "MIP",
"fare": {
"validatingCarrierCode": "DL",
"vita": true,
"eTicketable": true,
"lastTicketDate": "2019-07-05",
"governingCarriers": "KL",
"passengerInfoList": [
{
"passengerInfo": {
"passengerType": "ADT",
"passengerNumber": 1,
"nonRefundable": true,
"fareComponents": [
{
"ref": 1,
"segments": [
{
"segment": {
"bookingCode": "X",
"cabinCode": "Y",
"mealCode": "D",
"seatsAvailable": 9
}
},
{
"segment": {
"bookingCode": "X",
"cabinCode": "Y",
"mealCode": "RB",
"seatsAvailable": 9
}
},
{
"segment": {
"bookingCode": "L",
"cabinCode": "Y",
"mealCode": "M",
"seatsAvailable": 9,
"availabilityBreak": true
}
}
]
}
],
"taxes": [
{
"ref": 2
},
{
"ref": 1
},
{
"ref": 7
},
{
"ref": 4
},
{
"ref": 3
},
{
"ref": 5
},
{
"ref": 6
}
],
"taxSummaries": [
{
"ref": 2
},
{
"ref": 1
},
{
"ref": 3
},
{
"ref": 4
},
{
"ref": 7
},
{
"ref": 5
},
{
"ref": 6
}
],
"currencyConversion": {
"from": "INR",
"to": "USD",
"exchangeRateUsed": 0.01442679
},
"fareMessages": [
{
"type": "N",
"code": "0",
"carrier": "KL",
"info": "FARE RESTRICTIONS APPLY/CARRIER RESTRICTIONS APPLY"
},
{
"type": "W",
"code": "0",
"info": "VALIDATING CARRIER - DL PER GSA AGREEMENT WITH KL"
}
],
"passengerTotalFare": {
"totalFare": 264.5,
"totalTaxAmount": 208.5,
"currency": "USD",
"baseFareAmount": 3875,
"baseFareCurrency": "INR",
"equivalentAmount": 56,
"equivalentCurrency": "USD",
"constructionAmount": 55.59,
"constructionCurrency": "NUC",
"commissionPercentage": 0,
"commissionAmount": 0,
"exchangeRateOne": 69.651352
},
"baggageInformation": [
{
"provisionType": "A",
"airlineCode": "KL",
"segments": [
{
"id": 0
},
{
"id": 1
},
{
"id": 2
}
],
"allowance": {
"ref": 1
}
}
]
}
}
],
"totalFare": {
"totalPrice": 264.5,
"totalTaxAmount": 208.5,
"currency": "USD",
"baseFareAmount": 3875,
"baseFareCurrency": "INR",
"constructionAmount": 55.59,
"constructionCurrency": "NUC",
"equivalentAmount": 56,
"equivalentCurrency": "USD"
},
"validatingCarriers": [
{
"ref": 1
}
]
}
}
],
"diversitySwapper": {
"weighedPrice": 409.855
}
},
{
"id": 2,
"pricingSource": "ADVJR1",
"legs": [
{
"ref": 1
}
],
"pricingInformation": [
{
"pricingSubsource": "MIP",
"fare": {
"validatingCarrierCode": "DL",
"vita": true,
"eTicketable": true,
"lastTicketDate": "2019-07-05",
"governingCarriers": "KL",
"passengerInfoList": [
{
"passengerInfo": {
"passengerType": "ADT",
"passengerNumber": 1,
"nonRefundable": true,
"fareComponents": [
{
"ref": 1,
"segments": [
{
"segment": {
"bookingCode": "X",
"cabinCode": "Y",
"mealCode": "D",
"seatsAvailable": 9
}
},
{
"segment": {
"bookingCode": "X",
"cabinCode": "Y",
"mealCode": "RB",
"seatsAvailable": 9
}
},
{
"segment": {
"bookingCode": "L",
"cabinCode": "Y",
"mealCode": "M",
"seatsAvailable": 9,
"availabilityBreak": true
}
}
]
}
],
"taxes": [
{
"ref": 2
},
{
"ref": 1
},
{
"ref": 7
},
{
"ref": 4
},
{
"ref": 3
},
{
"ref": 5
},
{
"ref": 6
}
],
"taxSummaries": [
{
"ref": 2
},
{
"ref": 1
},
{
"ref": 3
},
{
"ref": 4
},
{
"ref": 7
},
{
"ref": 5
},
{
"ref": 6
}
],
"currencyConversion": {
"from": "INR",
"to": "USD",
"exchangeRateUsed": 0.01442679
},
"fareMessages": [
{
"type": "N",
"code": "0",
"carrier": "KL",
"info": "FARE RESTRICTIONS APPLY/CARRIER RESTRICTIONS APPLY"
},
{
"type": "W",
"code": "0",
"info": "VALIDATING CARRIER - DL PER GSA AGREEMENT WITH KL"
}
],
"passengerTotalFare": {
"totalFare": 264.5,
"totalTaxAmount": 208.5,
"currency": "USD",
"baseFareAmount": 3875,
"baseFareCurrency": "INR",
"equivalentAmount": 56,
"equivalentCurrency": "USD",
"constructionAmount": 55.59,
"constructionCurrency": "NUC",
"commissionPercentage": 0,
"commissionAmount": 0,
"exchangeRateOne": 69.651352
},
"baggageInformation": [
{
"provisionType": "A",
"airlineCode": "KL",
"segments": [
{
"id": 0
},
{
"id": 1
},
{
"id": 2
}
],
"allowance": {
"ref": 1
}
}
]
}
}
],
"totalFare": {
"totalPrice": 264.5,
"totalTaxAmount": 208.5,
"currency": "USD",
"baseFareAmount": 3875,
"baseFareCurrency": "INR",
"constructionAmount": 55.59,
"constructionCurrency": "NUC",
"equivalentAmount": 56,
"equivalentCurrency": "USD"
},
"validatingCarriers": [
{
"ref": 1
}
]
}
}
],
"diversitySwapper": {
"weighedPrice": 367.631
}
}
]
}
]
}
}
You have to use legDescs list to connect your segments, and use those "ref" values.
For example:
{
"id": 2,
"schedules": [
{
"ref": 3
},
{
"departureDateAdjustment": 1,
"ref": 4
},
{
"departureDateAdjustment": 1,
"ref": 1
}
]
}
means, your flight with ID = 2 contains 3 segments, with id 3 - 4 and 1. When you search numbered segments in "scheduleDescs" object, you can see routes are:
BLR - DEL
DEL - AMS
AMS - LCY
and as you can see you got the BLR - LCY flight.

Flutter Map a custom JSON to Object

I want to get an image URL from WP REST API, I was retrieving my posts to a List
so getting featuredImageUrl was like this :
A)
//THIS GETS AN URL TO ATTACHMENT WHEN IM USING A LIST<DYNAMIC>
featuredMediaAtta = posts[index]["_embedded"]["wp:featuredmedia"][0]["source_url"],
result is a url of embedded attachment, I want the same results in B
B)
I had to changed to Object Model from list to List>
The post model is:
Post.fromMap(Map<String, dynamic> map) {
if (map == null) {
return;
}
...
//I can retrieve featured media id successfully
featuredMediaID = map['featured_media'];
// BUT HERE I CAN NOT RETURN THE ATTACHMENT URL
featuredMediaAtta = map["_embedded"]["wp:featuredmedia"][0]["source_url"] ;
commentStatus = map['comment_status'];
...
here is the JSON response for getting
http://www.ehawal.com/wp-json/wp/v2/posts/73335?_embed
{
"id": 73335,
"date": "2018-12-01T20:05:26",
"date_gmt": "2018-12-01T20:05:26",
"guid": {
"rendered": "http://www.theUrl.com/?p=73335"
},
"modified": "2018-12-01T20:05:26",
"modified_gmt": "2018-12-01T20:05:26",
"slug": "%d8%a8%d9%88-%d9%88%db%8e%d9%86%d9%87%e2%80%8c%db%8c-%d9%86%d9%88%db%8e",
"status": "publish",
"type": "post",
"link": "http://www.theUrl.com/2018/12/01/%d8%a8%d9%88-%d9%88%db%8e%d9%86%d9%87%e2%80%8c%db%8c-%d9%86%d9%88%db%8e/",
"title": {
"rendered": "بو وێنه\u200cی نوێ"
},
"content": {
"rendered": "<p>وێمه\u200cی لكسادژڤ ؛لكژ اعس</p>\n<div class=\"theUrl_container\"
"protected": false
},
"excerpt": {
"rendered": "<p>وێمه\u200cی لكسادژڤ ؛لكژ اعس</p>\n<div class=\"theUrl_container\" style=\"\"><!-- theUrl.com BEGIN --><span class=\"theUrl-wrapper\"
"author": 1,
"featured_media": 73336,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [],
"categories": [
195,
1,
176
],
"tags": [],
"acf": [],
"_links": {
"self": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/posts/73335"
}
],
"collection": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/posts"
}
],
"about": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/types/post"
}
],
"author": [
{
"embeddable": true,
"href": "http://www.theUrl.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "http://www.theUrl.com/wp-json/wp/v2/comments?post=73335"
}
],
"version-history": [
{
"count": 1,
"href": "http://www.theUrl.com/wp-json/wp/v2/posts/73335/revisions"
}
],
"predecessor-version": [
{
"id": 73337,
"href": "http://www.theUrl.com/wp-json/wp/v2/posts/73335/revisions/73337"
}
],
"wp:featuredmedia": [
{
"embeddable": true,
"href": "http://www.theUrl.com/wp-json/wp/v2/media/73336"
}
],
"wp:attachment": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/media?parent=73335"
}
],
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "http://www.theUrl.com/wp-json/wp/v2/categories?post=73335"
},
{
"taxonomy": "post_tag",
"embeddable": true,
"href": "http://www.theUrl.com/wp-json/wp/v2/tags?post=73335"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
},
"_embedded": {
"author": [
{
"id": 1,
"name": "hooshyar_nuc",
"url": "",
"description": "",
"link": "http://www.theUrl.com/author/hooshyar_nuc/",
"slug": "hooshyar_nuc",
"avatar_urls": {
"24": "http://0.gravatar.com/avatar/f1a624f625d4271d52b7fc9445609eb5?s=24&d=mm&r=g",
"48": "http://0.gravatar.com/avatar/f1a624f625d4271d52b7fc9445609eb5?s=48&d=mm&r=g",
"96": "http://0.gravatar.com/avatar/f1a624f625d4271d52b7fc9445609eb5?s=96&d=mm&r=g"
},
"acf": [],
"_links": {
"self": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/users/1"
}
],
"collection": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/users"
}
]
}
}
],
"wp:featuredmedia": [
{
"id": 73336,
"date": "2018-12-01T20:05:10",
"slug": "guardian",
"type": "attachment",
"link": "http://www.theUrl.com/2018/12/01/%d8%a8%d9%88-%d9%88%db%8e%d9%86%d9%87%e2%80%8c%db%8c-%d9%86%d9%88%db%8e/guardian/",
"title": {
"rendered": "guardian"
},
"author": 1,
"acf": [],
"caption": {
"rendered": ""
},
"alt_text": "",
"media_type": "image",
"mime_type": "image/png",
"media_details": {
"width": 400,
"height": 155,
"file": "2018/12/guardian.png",
"sizes": {
"thumbnail": {
"file": "guardian-150x150.png",
"width": 150,
"height": 150,
"mime_type": "image/png",
"source_url": "http://www.theUrl.com/wp-content/uploads/2018/12/guardian-150x150.png"
},
"medium": {
"file": "guardian-300x116.png",
"width": 300,
"height": 116,
"mime_type": "image/png",
"source_url": "http://www.theUrl.com/wp-content/uploads/2018/12/guardian-300x116.png"
},
"tie-small": {
"file": "guardian-110x75.png",
"width": 110,
"height": 75,
"mime_type": "image/png",
"source_url": "http://www.theUrl.com/wp-content/uploads/2018/12/guardian-110x75.png"
},
"tie-medium": {
"file": "guardian-310x155.png",
"width": 310,
"height": 155,
"mime_type": "image/png",
"source_url": "http://www.theUrl.com/wp-content/uploads/2018/12/guardian-310x155.png"
},
"tie-large": {
"file": "guardian-310x155.png",
"width": 310,
"height": 155,
"mime_type": "image/png",
"source_url": "http://www.theUrl.com/wp-content/uploads/2018/12/guardian-310x155.png"
},
"full": {
"file": "guardian.png",
"width": 400,
"height": 155,
"mime_type": "image/png",
"source_url": "http://www.theUrl.com/wp-content/uploads/2018/12/guardian.png"
}
},
"image_meta": {
"aperture": "0",
"credit": "",
"camera": "",
"caption": "",
"created_timestamp": "0",
"copyright": "",
"focal_length": "0",
"iso": "0",
"shutter_speed": "0",
"title": "",
"orientation": "0",
"keywords": []
}
},
"source_url": "http://www.theUrl.com/wp-content/uploads/2018/12/guardian.png",
"_links": {
"self": [
{
"attributes": [],
"href": "http://www.theUrl.com/wp-json/wp/v2/media/73336"
}
],
"collection": [
{
"attributes": [],
"href": "http://www.theUrl.com/wp-json/wp/v2/media"
}
],
"about": [
{
"attributes": [],
"href": "http://www.theUrl.com/wp-json/wp/v2/types/attachment"
}
],
"author": [
{
"attributes": {
"embeddable": true
},
"href": "http://www.theUrl.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"attributes": {
"embeddable": true
},
"href": "http://www.theUrl.com/wp-json/wp/v2/comments?post=73336"
}
]
}
}
],
"wp:term": [
[
{
"id": 195,
"link": "http://www.theUrl.com/category/world/",
"name": "جیهان",
"slug": "world",
"taxonomy": "category",
"acf": [],
"_links": {
"self": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/categories/195"
}
],
"collection": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/categories"
}
],
"about": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/taxonomies/category"
}
],
"wp:post_type": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/posts?categories=195"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
},
{
"id": 1,
"link": "http://www.theUrl.com/category/all/",
"name": "سه\u200cره\u200cكی",
"slug": "all",
"taxonomy": "category",
"acf": [],
"_links": {
"self": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/categories/1"
}
],
"collection": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/categories"
}
],
"about": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/taxonomies/category"
}
],
"wp:post_type": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/posts?categories=1"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
},
{
"id": 176,
"link": "http://www.theUrl.com/category/grng/",
"name": "گرنگ",
"slug": "grng",
"taxonomy": "category",
"acf": [],
"_links": {
"self": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/categories/176"
}
],
"collection": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/categories"
}
],
"about": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/taxonomies/category"
}
],
"wp:post_type": [
{
"href": "http://www.theUrl.com/wp-json/wp/v2/posts?categories=176"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
],
[]
]
}
}

How to get a json key that contains a specific string with jq?

I have a json data like this:
{
"success": true,
"module": {
"endpoint": {
"mode": "pc",
"protocolVersion": "2.0"
},
"reload": true,
"data": {
"leftContainer_CL": {
"id": "CL",
"tag": "leftContainer",
"fields": {
"css": {
"floatPosition": "left",
"width": "788px"
},
"tag": "leftContainer"
},
"type": "container"
},
"container_C": {
"id": "C",
"tag": "container",
"fields": {
"css": {
"marginTop": "12px"
},
"tag": "container"
},
"type": "container"
},
"delivery_dfdaf8a8a": {
"id": "dfdaf8a8a",
"tag": "delivery",
"fields": {
"selectPos": "right",
"deliveryBy": {
"text": "Disediakan oleh",
"poster": "ALL ITEM STORE"
},
"options": [
{
"highlight": false,
"deliveryId": "STANDARD",
"bgColor": "#fafafa",
"price": "Rp18.900",
"disable": false,
"reachTime": "Dapatkan pada\n 3-4 Apr 2018",
"liveUp": false,
"selected": true
}
],
"style": "bar"
},
"type": "biz"
},
"rightContainer_CR": {
"id": "CR",
"tag": "rightContainer",
"fields": {
"css": {
"floatPosition": "right",
"width": "388px"
},
"tag": "rightContainer"
},
"type": "container"
},
"delivery_d43597338a": {
"id": "d43597338a",
"tag": "delivery",
"fields": {
"selectPos": "right",
"deliveryBy": {
"text": "Disediakan oleh",
"poster": "incredible accessories hp"
},
"options": [
{
"highlight": false,
"deliveryId": "STANDARD",
"bgColor": "#fafafa",
"price": "Rp37.800",
"disable": false,
"reachTime": "Dapatkan pada\n 3-4 Apr 2018",
"liveUp": false,
"selected": true
}
],
"style": "bar"
},
"type": "biz"
},
"orderSummary_6": {
"id": "6",
"tag": "orderSummary",
"fields": {
"isOpen": "false",
"summarys": [
{
"tail": "(3 barang)",
"title": "Subtotal",
"value": "Rp23.557"
},
{
"title": "Biaya pengiriman",
"value": "Rp56.700"
}
],
"title": "Ringkasan Pesanan\r\n"
},
"type": "biz"
},
"root_0": {
"id": "0",
"tag": "root",
"fields": {
"count": 3,
"title": "Troli belanja Saya"
},
"type": "root"
},
"item_i77997d6b": {
"id": "i77997d6b",
"tag": "item",
"fields": {
"img": "https://id-live.slatic.net/original/08c1396908dc240625751b09decb4211.jpg",
"quantity": {
"qtyPrefix": "Kuantitas",
"min": 1,
"autoOptions": false,
"quantity": 1,
"max": 5,
"editable": true,
"showIncrDecr": true,
"showOptions": false,
"step": 1
},
"sellerName": "ALL ITEM STORE",
"title": "Case Slim Black Matte Xiaomi Redmi 4A Softcase Black",
"stockTip": {},
"valid": true,
"itemId": "143800088",
"operations": [
"wishlist",
"delete"
],
"sellerId": "100124080",
"price": {
"price": 6000,
"currentPrice": "Rp6.000",
"originPrice": "Rp30.000",
"promotionRatio": "-80%"
},
"restriction": false,
"isGift": false,
"sku": {
"skuText": "Softcase, Hitam",
"productVariant": "SO908ELAAVYY4AANID-72544754",
"brandId": "17818",
"skuId": "157608391"
},
"itemUrl": "https://www.lazada.co.id/products/i143800088-s157608391.html?urlFlag=true&mp=1",
"cartItemId": 2006547819
},
"type": "biz"
},
"location_2": {
"id": "2",
"tag": "location",
"fields": {
"buttonText": "GANTI\r\n",
"editable": true,
"postCode": "",
"style": "casAddress",
"label": "Lokasi",
"title": "Jawa Tengah,Kab. Boyolali,Ampel",
"addressId": "R2388357-R80010396-R80015219"
},
"type": "biz"
},
"voucherInput_7": {
"id": "7",
"tag": "voucherInput",
"fields": {
"buttonText": "GUNAKAN",
"placeHolder": "Masukkan Kode Voucher",
"status": "default"
},
"type": "biz",
"validate": {
"value": [
{
"msg": "Maaf, voucher ini tidak dapat digunakan. Silahkan periksa jika ada kesalahan penulisan",
"regex": "^$|^[ ]{0,5}[A-Za-z0-9~!##%&*()_+?<>{}|-]{1,100}[ ]{0,5}$"
}
]
}
},
"shop_43597338a_s2c": {
"id": "43597338a_s2c",
"tag": "shop",
"fields": {
"badges": [],
"link": "//www.lazada.co.id/shop/incredible-accessories-hp",
"name": "incredible accessories hp"
},
"type": "biz"
},
"item_i7799f86e": {
"id": "i7799f86e",
"tag": "item",
"fields": {
"img": "http://id-live-02.slatic.net/p/2/case-anti-shock-anti-crack-elegant-softcase-for-xiaomi-redmi-5a-white-clear-free-tempered-glass-1273-94487227-9f8ddff53bde3f8de9eb514ba2172361-catalog.jpg",
"quantity": {
"qtyPrefix": "Kuantitas",
"min": 1,
"autoOptions": false,
"quantity": 1,
"max": 5,
"editable": true,
"showIncrDecr": true,
"showOptions": false,
"step": 1
},
"sellerName": "incredible accessories hp",
"title": "Case Anti Shock / Anti Crack Elegant Softcase for Xiaomi Redmi 5A - White Clear + Free Tempered Glass",
"stockTip": {},
"valid": true,
"itemId": "160714927",
"operations": [
"wishlist",
"delete"
],
"sellerId": "53631",
"price": {
"price": 13580,
"currentPrice": "Rp13.580",
"originPrice": "Rp25.000",
"promotionRatio": "-46%"
},
"restriction": false,
"isGift": false,
"sku": {
"skuText": "Softcase, Bening",
"productVariant": "SO908ELAB716EPANID-97510528",
"brandId": "17818",
"skuId": "183461134"
},
"itemUrl": "https://www.lazada.co.id/products/i160714927-s183461134.html?urlFlag=true&mp=1",
"cartItemId": 2006579310
},
"type": "biz"
},
"package_p43597338a": {
"id": "p43597338a",
"tag": "package",
"fields": {},
"type": "biz"
},
"listHeader_H": {
"id": "H",
"tag": "listHeader",
"fields": {
"middle": "HARGA",
"left": "3 barang",
"right": "KUANTITAS"
},
"type": "biz"
},
"delivery_3": {
"id": "3",
"tag": "delivery",
"fields": {
"selectPos": "left",
"options": [
{
"highlight": false,
"deliveryId": "STANDARD",
"bgColor": "#fafafa",
"price": "Rp56.700",
"disable": false,
"icon": "https://laz-img-cdn.alicdn.com/tfs/TB1UpyCpfDH8KJjy1XcXXcpdXXa-72-72.png",
"name": "Standar",
"reachTime": "Dapatkan pada\n 3-4 Apr 2018",
"liveUp": false,
"selected": true
}
],
"style": "card",
"title": "Pengiriman yang dipilih"
},
"type": "biz"
},
"orderTotal_8": {
"id": "8",
"tag": "orderTotal",
"fields": {
"button": {
"enable": true,
"text": "LANJUTKAN KE PEMBAYARAN",
"clicked": false
},
"payment": {
"taxTip": "Termasuk PPN, jika berlaku",
"pay": "Rp80.257",
"title": "Total"
}
},
"type": "biz"
},
"shop_fdaf8a8a_s23f9": {
"id": "fdaf8a8a_s23f9",
"tag": "shop",
"fields": {
"badges": [],
"link": "//www.lazada.co.id/shop/all-item-store",
"name": "ALL ITEM STORE"
},
"type": "biz"
},
"floatTips_4": {
"id": "4",
"tag": "floatTips",
"fields": {
"tips": []
},
"type": "biz"
},
"item_i7790e0f9": {
"id": "i7790e0f9",
"tag": "item",
"fields": {
"img": "http://id-live-02.slatic.net/p/2/case-anti-shock-anti-crack-elegant-softcase-for-xiaomi-redmi-note4x-white-clear-8431-85175402-0bec01e88741744ae5461c4b3a4ae160-catalog.jpg",
"quantity": {
"qtyPrefix": "Kuantitas",
"min": 1,
"autoOptions": false,
"quantity": 1,
"max": 5,
"editable": true,
"showIncrDecr": true,
"showOptions": false,
"step": 1
},
"sellerName": "incredible accessories hp",
"title": "Case Anti Shock / Anti Crack Elegant Softcase for Xiaomi Redmi Note 4x - White Clear",
"stockTip": {},
"valid": true,
"itemId": "108849535",
"operations": [
"wishlist",
"delete"
],
"sellerId": "53631",
"price": {
"price": 3977,
"currentPrice": "Rp3.977",
"originPrice": "Rp15.000",
"promotionRatio": "-73%"
},
"restriction": false,
"isGift": false,
"sku": {
"skuText": "Sarung, Bening",
"productVariant": "CA529ELAAC6GUEANID-27304198",
"brandId": "10464",
"skuId": "110628148"
},
"itemUrl": "https://www.lazada.co.id/products/i108849535-s110628148.html?urlFlag=true&mp=1",
"cartItemId": 2005983481
},
"type": "biz"
},
"package_pfdaf8a8a": {
"id": "pfdaf8a8a",
"tag": "package",
"fields": {},
"type": "biz"
}
},
"hierarchy": {
"component": [
"container",
"delivery",
"item",
"shop",
"package",
"listHeader",
"orderSummary",
"leftContainer",
"orderTotal",
"floatTips",
"root",
"location",
"rightContainer",
"voucherInput"
],
"root": "root_0",
"structure": {
"package_p43597338a": [
"delivery_d43597338a",
"shop_43597338a_s2c",
"item_i7799f86e",
"item_i7790e0f9"
],
"leftContainer_CL": [
"delivery_3",
"listHeader_H",
"package_pfdaf8a8a",
"package_p43597338a"
],
"container_C": [
"leftContainer_CL",
"rightContainer_CR"
],
"rightContainer_CR": [
"location_2",
"orderSummary_6"
],
"orderSummary_6": [
"voucherInput_7",
"orderTotal_8"
],
"root_0": [
"container_C",
"floatTips_4"
],
"package_pfdaf8a8a": [
"delivery_dfdaf8a8a",
"shop_fdaf8a8a_s23f9",
"item_i77997d6b"
]
}
},
"linkage": {
"input": [],
"request": [
"voucherInput_7",
"item_i7799f86e",
"delivery_3",
"orderTotal_8",
"item_i7790e0f9",
"location_2",
"item_i77997d6b"
],
"common": {
"compress": true,
"queryParams": "^^$$1afe141216814f45e9fc6dba84d4863d{$_$}H4sIAAAAAAAAAFWU247bRgyGXyXQ9caYGXJOe5fkJmmLot3de4Ez5OwKlSVBklMkQd69lJsNHBgwZIHfz9NPf+t2Wc/DRGN3/61bRtrbvJ67+26p3V230LPoc6V1777fdROd5XGh+vpu05DLJuu7bRuep0OgjrRtf2rYETGfTyN9JabTNfh0nlnG02Xc13k6LbTSeTv9fZH1y1/XZxVbZWJZ3w9ff7xRxXGutA/z9DTs46H6G/1Lb55keqaXu9+pnN68n7/MI43D3bvzIqOKEPMq2/aJNfrBQUrg49uHZIw1kMP/T97ZfPQ3b/sHrUoju+/aoJa8zJNM+/aoDdF+WeXa1TztNEyy9h800jUoDoPFWnMIVHwCMMiWCJ2zgVRX+xw+a2M9aHyMsbpqwcUChTgxeMZqbWzkJXl7G88IPkeARApKMCYQeJNYojCEVPTboMcCmOIvibgxtURXLrRaKGKrWdhHMslkE1ss2TjnCA+ujTPtT8Oy9XgkilVQsgEX2AXJgQ3UZCNb1yKEY1LDLud+iDEbMS0rYwAzx+KbE6JmcgCbs02YJShhyi2TI4eiTAHr0ROiZS0mOteYW9JChZwR+CVPbikce2Ev4HJiJmuab6TJIApIkZo4JFZmlKZb/LmiP66jqzVlEhe5GJEUs/XNk6csxYacDmrY9o9C6rf+oxJAHqAkJMc69RbZu+yBQKxFqTEcxA8r9u5wgagLRISDNuECYjAFk3NYUnU+Htczryr+eDmfSRcUlNEukSyVmqLXeNG9NnWF16RBV95emad5p7FPx5QNGnSUpHDUllsyGINQUKSp78L1Rus/eqb9cmsdgGp1vmpLcKjD1JsNTUGdqmu6olvuxjmlpaa7KV6wtkqU1UimOXA6gIjXk1mH55fbaT8olhJJMhFrrlwxRwuAmK00ELD6+8Dmee9Ndz9dxvGu217mpf9Zb7+5qirZ1YoYOXJlWw1r1Zz1w7kAxKvKlXutVzG4WlFvGUyKxkhB9RNL9ibmmoGTnkJFBT/Pl/oi66dpuex9VMa65LRQ0fRWnDjSZDogFZJkkYL+HfwHDyba3BsFAAA=",
"submitParams": "^^$$f7898231e0216a924bcaa64d213a61ba{$_$}H4sIAAAAAAAAADXMQQrDMAwEwL/oHPSA3PqBUsgLto4bDJJtJPvS4L/XCfS2uwx7UoumKUNoPakK2qeY0ko10EIVR5w5wBqNhTI0bhXhv/kk3aM93NORr4MgcH9OdomiLPhiB9+YtexRuEuzkrnCoM5bf2tqr7vQGD8eVpdVjwAAAA=="
},
"signature": "89dffd9ca23307e603556a4c896e4c56"
}
}
}
With jq I can do this:
[me#linux]$ cat /tmp/json | jq '.module | .data | keys'
[
"container_C",
"delivery_3",
"delivery_d43597338a",
"delivery_dfdaf8a8a",
"floatTips_4",
"item_i7790e0f9",
"item_i77997d6b",
"item_i7799f86e",
"leftContainer_CL",
"listHeader_H",
"location_2",
"orderSummary_6",
"orderTotal_8",
"package_p43597338a",
"package_pfdaf8a8a",
"rightContainer_CR",
"root_0",
"shop_43597338a_s2c",
"shop_fdaf8a8a_s23f9",
"voucherInput_7"
]
I need to get orderTotal_8 but please note that the number 8 is always changing, so it can be orderTotal_10 or orderTotal_3 etc... How can I get this key with pure jq command if possible, without the help of grep / awk ? So the result should be like this orderTotal_8
If you want to form a subarray of items satisfying some condition, just add map(select( CONDITION )) to the pipeline, e.g.
.module | .data | keys | map(select(test("^orderTotal_")))
If you just want a stream of the items matching the condition, then you could first form the stream, and then make the selection:
.module | .data | keys[] | select(test("^orderTotal_"))
For efficiency and other reasons, you might want to consider using keys_unsorted instead of keys.

Convert json to include name and children values to feed D3

I am trying to get json converted from:
{
"Devices": [
{
"Udid": "7a2b0e6c928f2321a75e423ba23ae93d",
"SerialNumber": "RF1D232ZLEE",
"MacAddress": "40F232726FC8",
"Imei": "3576342323280150",
"EasId": "SEC1BC252327E92B",
"AssetNumber": "7a2b0e23223928f2321a75e423ba23ae93d",
"DeviceFriendlyName": "gel1 Android Android 5.0.1 ZLEE ",
"LocationGroupId": {
"Id": {
"Value": 19529
},
"Name": "Group Express"
},
"LocationGroupName": "Group Express",
"UserId": {
"Name": ""
},
"UserName": "",
"UserEmailAddress": "",
"Ownership": "S",
"PlatformId": {
"Id": {
"Value": 5
},
"Name": "Android"
},
"Platform": "Android",
"ModelId": {
"Id": {
"Value": 5
},
"Name": "samsung GT-I9505"
},
"Model": "samsung GT-I9505",
"OperatingSystem": "5.0.1",
"PhoneNumber": "+447881867010",
"LastSeen": "2016-07-06T14:01:03.590",
"EnrollmentStatus": "Unenrolled",
"ComplianceStatus": "NotAvailable",
"CompromisedStatus": false,
"LastEnrolledOn": "2016-06-15T16:01:38.763",
"LastComplianceCheckOn": "0001-01-01T00:00:00.000",
"LastCompromisedCheckOn": "2016-07-06T13:58:26.183",
"IsSupervised": false,
"DeviceMCC": {
"SIMMCC": "234",
"CurrentMCC": "234"
},
"AcLineStatus": 0,
"VirtualMemory": 0,
"Id": {
"Value": 23459
}
},
{
"Udid": "c5f94db71d406dae7f881d3edf059e",
"SerialNumber": "",
"MacAddress": "000C300F9108",
"Imei": "",
"EasId": "D80DB85EC411C8E9B28BC292A603F05C2C0EEEC8",
"AssetNumber": "c592f93db71d406dae7f881d3edf059e",
"DeviceFriendlyName": "user Windows 10 WinRT 10.0.10240 ",
"LocationGroupId": {
"Id": {
"Value": 18498
},
"Name": "Business Solutions"
},
"LocationGroupName": "Business Solutions",
"UserId": {
"Name": ""
},
"UserName": "",
"UserEmailAddress": "",
"Ownership": "C",
"PlatformId": {
"Id": {
"Value": 12
},
"Name": "WinRT"
},
"Platform": "WinRT",
"ModelId": {
"Id": {
"Value": 50
},
"Name": "Windows 10"
},
"Model": "Windows 10",
"OperatingSystem": "10.0.10240",
"PhoneNumber": "",
"LastSeen": "2016-05-03T10:54:07.650",
"EnrollmentStatus": "Unenrolled",
"ComplianceStatus": "NotAvailable",
"CompromisedStatus": false,
"LastEnrolledOn": "2016-01-29T16:41:57.760",
"LastComplianceCheckOn": "0001-01-01T00:00:00.000",
"LastCompromisedCheckOn": "0001-01-01T00:00:00.000",
"IsSupervised": false,
"DeviceMCC": {
"SIMMCC": "",
"CurrentMCC": ""
},
"AcLineStatus": 0,
"VirtualMemory": 0,
"Id": {
"Value": 23545
}
}
],
"Page": 0,
"PageSize": 500,
"Total": 13}
To something like:
{"name": "Devices",
"children": [
{"name":"Udid", "size":"7f0dsda63274692ea4f0b66fec67a020158"},
{"name":"SerialNumber", "size":"P988KJSPQF938"},
{"name":"MacAddress", "size":"1HJUSUD031C4"},
{"name":"Imei", "size":""},
{"name":"EasId", "size":"ApKJSPQF193"},
{"name":"AssetNumber", "size":"7f0cda636b3305fea4f0b66fec9997267a020158"},
{"name":"DeviceFriendlyName", "size":"TMcKenz iPad iOS 7.1.4 F193 "},
{"name":"LocationGroupId",
"children": [
{"name":"Id","size":7488},
{"name":"Name","size":"MCM"}
]
},
{"name":"UserId",
"children": [
{"name":"Id","size":6418},
{"name":"Name","size":"Tom McKenz"}
]
},
{"name":"UserName", "size":"TMcKenz"},
{"name":"UserEmailAddress", "size":"TMcKenz#awaw.com"}
]
}
Not sure what is the best practice here: is it possible to use D3.nest or do you need to iterate through all the nodes and change to 'name' and 'children' accordingly.

Drupal 7 Feed Import

I am now struggling for hours but I cannot get my feed import to run properly.
The strange is, that I can import data for the normal fields in Drupal like "Title" or "Language" or "User". But for my custom fields like "field_produkt_beschreibung", no entries are made in Drupal. Even if I supply a Standard Value for the field:
The standard value is not saved in the node.
{
"entity": "node",
"settings": {
"uniq_path": "SKU",
"preprocess": "",
"feed": {
"protect_on_invalid_source": 0,
"protect_on_fewer_items": "0"
},
"processor": {
"name": "default",
"class": "FeedImportProcessor",
"options": {
"items_count": "0",
"skip_imported": 0,
"updates_only": 0,
"reset_cache": "0",
"throw_exception": 1,
"max_reported_errors": "100",
"break_on_undefined_filter": 0,
"skip_defined_functions_check": 0,
"uniq_callback": "",
"after_save": "",
"before_combine": "",
"after_combine": "",
"before_create": "",
"before_save": ""
}
},
"reader": {
"name": "sql",
"class": "SQLFIReader",
"options": {
"dsn": "mysql:dbname=d****7;host=localhost",
"user": "d******7",
"pass": "*****",
"query": "SELECT * FROM mytable",
"params": ""
}
},
"hashes": {
"name": "sql",
"class": "FeedImportSQLHashes",
"options": {
"ttl": 0,
"insert_chunk": 300,
"update_chunk": 300,
"group": "produkte_h_lter"
}
},
"filter": {
"name": "default",
"class": "FeedImportMultiFilter",
"options": {
"param": "[field]",
"include": ""
}
},
"fields": {
"title": {
"field": "title",
"column": false,
"paths": [
"Produktname"
],
"default_action": 0,
"default_value": "Standardwert",
"update_mode": 0,
"filters": {
"\u00fc": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ü",
"\u00fc",
"1"
]
},
"\u00e4": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ä",
"\u00e4",
"1"
]
},
"\u00d6": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"Ö",
"\u00d6",
"1"
]
},
"\u00f6": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ö",
"\u00f6",
"1"
]
},
"\u00df": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ß",
"\u00df",
"1"
]
},
"R": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"®",
" ",
"1"
]
}
},
"prefilters": []
},
"field_produkt_hersteller_raw": {
"field": "field_produkt_hersteller_raw",
"column": true,
"paths": [
"//Hersteller"
],
"default_action": 0,
"default_value": "kein Hersteller",
"update_mode": 0,
"filters": [],
"prefilters": []
},
"field_produkt_link": {
"field": "field_produkt_link",
"column": true,
"paths": [
"Link"
],
"default_action": 0,
"default_value": "Standard",
"update_mode": 0,
"filters": [],
"prefilters": []
},
"field_produkt_artikelnummer": {
"field": "field_produkt_artikelnummer",
"column": true,
"paths": [
"Artikelnummer"
],
"default_action": 0,
"default_value": "Standardwert",
"update_mode": 0,
"filters": [],
"prefilters": []
},
"field_produkt_beschreibung": {
"field": "field_produkt_beschreibung",
"column": true,
"paths": [
"Beschreibung"
],
"default_action": 0,
"default_value": "Text",
"update_mode": 0,
"filters": {
"\u00fc": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ü",
"\u00fc",
"1"
]
},
"\u00e4": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ä",
"\u00e4",
"1"
]
},
"\u00d6": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"Ö",
"\u00d6",
"1"
]
},
"\u00f6": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ö",
"\u00f6",
"1"
]
},
"\u00df": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"ß",
"\u00df",
"1"
]
},
"R": {
"function": "FeedImportFilter::replace",
"params": [
"[field]",
"®",
" ",
"1"
]
}
},
"prefilters": []
}
},
"static_fields": {
"type": "produkt",
"uid": "3",
"language": "de",
"field_produkt_shop": {
"tid": "20"
},
"title": "Test"
},
"functions": []
}
}
I really would appreciate a hint, about what might be wrong with my setup. Thank you very much,
Simon
It was missing filters and umlaute (ä, ö...) in the text fields. It is working now