I’m faced with what feels like a massive task to create a target JSON structure for a POST API call which books a flight:
I believe that the rough steps would be:
- To prepare the data in the bubbleDB
- Generate JSON code via concatenation
- Post that JSON code
But the challenge is the complexity of the target structure:
1 flight offer to n itineraries.
1 itinerary to n segments.
1 departure per segment, 3 attributes to each departure
1 arrival per segment, 3 attributes to each arrival
1 aircraft per segment, 1 aircraft code per aircraft
… and much more…
I need some help with design principles here… has anyone tackled anything of this nature?