Here’s an outline with best practices for making your inquiry.
My question: Is there a way to fetch the values of a single key which is having multiple instances throughout the json object response?
Would it be possible to fetch and print all the ‘flight_prices’ which is occurring multiple times throughout the response?
I have another question as to why can’t we use ‘*’ in the jsonpath in Postman if it part of the jsonpath library already. It even works for jsonpath online formatting tool.
Details (like screenshots):
Sample JSON Response:
{
"itineraries": [
{
"number": 1,
"origin_airport": "LAX",
"destination_airport": "SFO",
"more_details": [
{
"number": 1,
"segments": [
{
"number": 1,
"flight_number": 123,
"legs": [
{
"cabins": [
{
"cabin_class": "Economy",
"seats_remaining": 5,
"flight_prices":[
20.2,
25.3,
30.1,
50.24,
120.12
]
}
]
}
]
},
{
"number": 2,
"flight_number": 123,
"legs": [
{
"cabins": [
{
"cabin_class": "Premium_Economy",
"seats_remaining": 5,
"flight_prices":[
120.2,
125.3,
130.1,
150.24,
220.12
]
}
]
}
]
},
{
"number": 3,
"flight_number": 123,
"legs": [
{
"cabins": [
{
"cabin_class": "Business",
"seats_remaining": 5,
"flight_prices":[
220.2,
225.3,
230.1,
250.24,
320.12
]
}
]
}
]
}
]
}
]
}
]
}