Displaying contents of a non-identifiable array that is the result of a JSON API call

Hello,

I'm trying to write a swiftui-based train departure board app and I'm calling an API to return data in JSON format. That's all working fine and the data is correctly being returned into the following structure:

struct Response: Codable { let location: Location let services: [RailService]? }

struct Location: Codable { let name: String? let tiploc: String? }

struct RailService: Codable { let locationDetail: LocationDetail? let serviceUid : String? let runDate, trainIdentity, runningIdentity: String? let atocName: String? }

struct LocationDetail: Codable { let description: String? let gbttBookedArrival, gbttBookedDeparture: String? let origin, destination: [Destination]? let isCall, isPublicCall: Bool? let realtimeArrival: String? let realtimeArrivalActual: Bool? let realtimeDeparture: String? let realtimeDepartureActual: Bool? let platform : String? let platformConfirmed : Bool? let platformChanged : Bool? let serviceLocation : String? let cancelReasonCode : String? let cancelReasonShortText: String? let cancelReasonLongText : String? }

struct Destination: Codable { let description: String? let workingTime, publicTime: String? }

My question is, I'd like to display the array 'services' of type RailService in a swiftui view but it's not Identifiable. How can display each element of the array and its items in swiftui?

Many thanks.

Displaying contents of a non-identifiable array that is the result of a JSON API call
 
 
Q