I have certain situation where the schema information fetched in Wappler is missing some parts.
I normally try use a fetch first, and if that works or not, I check the schema it has pulled through and if parts are missing, i then paste the data
attribute and run it to try correct it, however sometimes even that method seems to not get all the schema needed. In those instances can I manually add arrays and objects to the list, and is that advisable.
Here is an example from the Amadeus API I have worked with many many times for quite a few clients.
This is the JSON inside the data
attribute.
{
"meta": {
"count": 1,
"links": {
"self": "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=SYD&destinationLocationCode=DXB&departureDate=2020-08-01&returnDate=2020-08-20&adults=1&max=1"
}
},
"data": [
{
"type": "flight-offer",
"id": "1",
"source": "GDS",
"instantTicketingRequired": false,
"nonHomogeneous": false,
"oneWay": false,
"lastTicketingDate": "2020-08-01",
"numberOfBookableSeats": 2,
"itineraries": [
{
"duration": "PT39H15M",
"segments": [
{
"departure": {
"iataCode": "SYD",
"terminal": "1",
"at": "2020-08-01T09:45:00"
},
"arrival": {
"iataCode": "DEL",
"terminal": "3",
"at": "2020-08-01T18:35:00"
},
"carrierCode": "AI",
"number": "301",
"aircraft": {
"code": "788"
},
"operating": {
"carrierCode": "AI"
},
"duration": "PT13H20M",
"id": "1",
"numberOfStops": 0,
"blacklistedInEU": false
},
{
"departure": {
"iataCode": "DEL",
"terminal": "3",
"at": "2020-08-02T16:50:00"
},
"arrival": {
"iataCode": "DXB",
"terminal": "1",
"at": "2020-08-02T19:00:00"
},
"carrierCode": "AI",
"number": "915",
"aircraft": {
"code": "788"
},
"operating": {
"carrierCode": "AI"
},
"duration": "PT3H40M",
"id": "2",
"numberOfStops": 0,
"blacklistedInEU": false
}
]
},
{
"duration": "PT27H20M",
"segments": [
{
"departure": {
"iataCode": "DXB",
"terminal": "1",
"at": "2020-08-20T20:50:00"
},
"arrival": {
"iataCode": "DEL",
"terminal": "3",
"at": "2020-08-21T02:00:00"
},
"carrierCode": "AI",
"number": "916",
"aircraft": {
"code": "788"
},
"operating": {
"carrierCode": "AI"
},
"duration": "PT3H40M",
"id": "3",
"numberOfStops": 0,
"blacklistedInEU": false
},
{
"departure": {
"iataCode": "DEL",
"terminal": "3",
"at": "2020-08-21T13:15:00"
},
"arrival": {
"iataCode": "SYD",
"terminal": "1",
"at": "2020-08-22T06:10:00"
},
"carrierCode": "AI",
"number": "302",
"aircraft": {
"code": "788"
},
"operating": {
"carrierCode": "AI"
},
"duration": "PT12H25M",
"id": "4",
"numberOfStops": 0,
"blacklistedInEU": false
}
]
}
],
"price": {
"currency": "EUR",
"total": "994.27",
"base": "868.00",
"fees": [
{
"amount": "0.00",
"type": "SUPPLIER"
},
{
"amount": "0.00",
"type": "TICKETING"
}
],
"grandTotal": "994.27"
},
"pricingOptions": {
"fareType": [
"PUBLISHED"
],
"includedCheckedBagsOnly": true
},
"validatingAirlineCodes": [
"AI"
],
"travelerPricings": [
{
"travelerId": "1",
"fareOption": "STANDARD",
"travelerType": "ADULT",
"price": {
"currency": "EUR",
"total": "994.27",
"base": "868.00"
},
"fareDetailsBySegment": [
{
"segmentId": "1",
"cabin": "ECONOMY",
"fareBasis": "UE6MAU6F",
"class": "U",
"includedCheckedBags": {
"weight": 30,
"weightUnit": "KG"
}
},
{
"segmentId": "2",
"cabin": "ECONOMY",
"fareBasis": "UE6MAU6F",
"class": "U",
"includedCheckedBags": {
"weight": 30,
"weightUnit": "KG"
}
},
{
"segmentId": "3",
"cabin": "ECONOMY",
"fareBasis": "TE3MAU6F",
"class": "T",
"includedCheckedBags": {
"weight": 30,
"weightUnit": "KG"
}
},
{
"segmentId": "4",
"cabin": "ECONOMY",
"fareBasis": "TE3MAU6F",
"class": "T",
"includedCheckedBags": {
"weight": 30,
"weightUnit": "KG"
}
}
]
}
]
}
],
"dictionaries": {
"locations": {
"DEL": {
"cityCode": "DEL",
"countryCode": "IN"
},
"DXB": {
"cityCode": "DXB",
"countryCode": "AE"
},
"SYD": {
"cityCode": "SYD",
"countryCode": "AU"
}
},
"aircraft": {
"788": "BOEING 787-8"
},
"currencies": {
"EUR": "EURO"
},
"carriers": {
"AI": "AIR INDIA"
}
}
}
And here is the schema produced when i copy and paste the above JSON into the server connect API Schema Editor
The Segments section is my main concern as the arrival, departure etc are all missing, so can i just add them back in there manually?
Last updated: