Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: NAV-193 - Set headsign as an optional field #122

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

munterfi
Copy link
Member

@munterfi munterfi commented Sep 24, 2024

Now also GTFS for Germany works:

curl -X 'GET' \
  'http://localhost:8080/routing/connections?sourceStopId=518959&targetStopId=476652&timeType=DEPARTURE&minTransferTime=0&wheelchairAccessible=false&bikeAllowed=false' \
  -H 'accept: */*'
[
  {
    "legs": [
      {
        "type": "ROUTE",
        "from": {
          "latitude": 52.503067,
          "longitude": 13.469961
        },
        "to": {
          "latitude": 52.525097,
          "longitude": 13.369321
        },
        "fromStop": {
          "id": "651634",
          "name": "Berlin Ostkreuz",
          "coordinates": {
            "latitude": 52.503067,
            "longitude": 13.469961
          }
        },
        "toStop": {
          "id": "159191",
          "name": "Berlin Hbf",
          "coordinates": {
            "latitude": 52.525097,
            "longitude": 13.369321
          }
        },
        "departureTime": "2024-09-24T15:17:00",
        "arrivalTime": "2024-09-24T15:33:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "2161",
            "name": "",
            "shortName": "FEX",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "352804",
                "name": "Flughafen BER",
                "coordinates": {
                  "latitude": 52.364063,
                  "longitude": 13.509307
                }
              },
              "arrivalTime": "2024-09-24T14:58:00",
              "departureTime": "2024-09-24T14:58:00"
            },
            {
              "stop": {
                "id": "414873",
                "name": "Berlin-Schöneweide",
                "coordinates": {
                  "latitude": 52.45469,
                  "longitude": 13.509638
                }
              },
              "arrivalTime": "2024-09-24T15:09:00",
              "departureTime": "2024-09-24T15:09:00"
            },
            {
              "stop": {
                "id": "651634",
                "name": "Berlin Ostkreuz",
                "coordinates": {
                  "latitude": 52.503067,
                  "longitude": 13.469961
                }
              },
              "arrivalTime": "2024-09-24T15:15:00",
              "departureTime": "2024-09-24T15:17:00"
            },
            {
              "stop": {
                "id": "142231",
                "name": "Berlin Gesundbrunnen",
                "coordinates": {
                  "latitude": 52.54869,
                  "longitude": 13.390501
                }
              },
              "arrivalTime": "2024-09-24T15:27:00",
              "departureTime": "2024-09-24T15:29:00"
            },
            {
              "stop": {
                "id": "159191",
                "name": "Berlin Hbf",
                "coordinates": {
                  "latitude": 52.525097,
                  "longitude": 13.369321
                }
              },
              "arrivalTime": "2024-09-24T15:33:00",
              "departureTime": "2024-09-24T15:33:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 52.525097,
          "longitude": 13.369321
        },
        "to": {
          "latitude": 47.547405,
          "longitude": 7.589551
        },
        "fromStop": {
          "id": "159191",
          "name": "Berlin Hbf",
          "coordinates": {
            "latitude": 52.525097,
            "longitude": 13.369321
          }
        },
        "toStop": {
          "id": "558791",
          "name": "Basel SBB",
          "coordinates": {
            "latitude": 47.547405,
            "longitude": 7.589551
          }
        },
        "departureTime": "2024-09-24T21:01:00",
        "arrivalTime": "2024-09-25T07:20:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "8204",
            "name": "",
            "shortName": "12N",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "159191",
                "name": "Berlin Hbf",
                "coordinates": {
                  "latitude": 52.525097,
                  "longitude": 13.369321
                }
              },
              "arrivalTime": "2024-09-24T21:01:00",
              "departureTime": "2024-09-24T21:01:00"
            },
            {
              "stop": {
                "id": "409219",
                "name": "Lutherstadt Wittenberg Hbf",
                "coordinates": {
                  "latitude": 51.86781,
                  "longitude": 12.662285
                }
              },
              "arrivalTime": "2024-09-24T21:47:00",
              "departureTime": "2024-09-24T21:49:00"
            },
            {
              "stop": {
                "id": "441032",
                "name": "Bitterfeld",
                "coordinates": {
                  "latitude": 51.62286,
                  "longitude": 12.31685
                }
              },
              "arrivalTime": "2024-09-24T22:07:00",
              "departureTime": "2024-09-24T22:09:00"
            },
            {
              "stop": {
                "id": "117818",
                "name": "Halle(Saale)Hbf",
                "coordinates": {
                  "latitude": 51.47751,
                  "longitude": 11.987085
                }
              },
              "arrivalTime": "2024-09-24T22:27:00",
              "departureTime": "2024-09-24T22:29:00"
            },
            {
              "stop": {
                "id": "14486",
                "name": "Leipzig Hbf",
                "coordinates": {
                  "latitude": 51.34547,
                  "longitude": 12.382064
                }
              },
              "arrivalTime": "2024-09-24T22:49:00",
              "departureTime": "2024-09-24T23:46:00"
            },
            {
              "stop": {
                "id": "60016",
                "name": "Erfurt Hbf",
                "coordinates": {
                  "latitude": 50.972355,
                  "longitude": 11.037993
                }
              },
              "arrivalTime": "2024-09-25T01:22:00",
              "departureTime": "2024-09-25T01:24:00"
            },
            {
              "stop": {
                "id": "255610",
                "name": "Fulda",
                "coordinates": {
                  "latitude": 50.555016,
                  "longitude": 9.683904
                }
              },
              "arrivalTime": "2024-09-25T02:45:00",
              "departureTime": "2024-09-25T02:47:00"
            },
            {
              "stop": {
                "id": "168303",
                "name": "Frankfurt(Main)Süd",
                "coordinates": {
                  "latitude": 50.099045,
                  "longitude": 8.685675
                }
              },
              "arrivalTime": "2024-09-25T03:41:00",
              "departureTime": "2024-09-25T03:43:00"
            },
            {
              "stop": {
                "id": "14819",
                "name": "Karlsruhe Hbf",
                "coordinates": {
                  "latitude": 48.993732,
                  "longitude": 8.401071
                }
              },
              "arrivalTime": "2024-09-25T05:07:00",
              "departureTime": "2024-09-25T05:09:00"
            },
            {
              "stop": {
                "id": "135031",
                "name": "Baden-Baden",
                "coordinates": {
                  "latitude": 48.790478,
                  "longitude": 8.190417
                }
              },
              "arrivalTime": "2024-09-25T05:26:00",
              "departureTime": "2024-09-25T05:28:00"
            },
            {
              "stop": {
                "id": "363634",
                "name": "Offenburg",
                "coordinates": {
                  "latitude": 48.476475,
                  "longitude": 7.946723
                }
              },
              "arrivalTime": "2024-09-25T05:45:00",
              "departureTime": "2024-09-25T05:47:00"
            },
            {
              "stop": {
                "id": "522807",
                "name": "Freiburg(Breisgau) Hbf",
                "coordinates": {
                  "latitude": 47.997765,
                  "longitude": 7.841295
                }
              },
              "arrivalTime": "2024-09-25T06:17:00",
              "departureTime": "2024-09-25T06:19:00"
            },
            {
              "stop": {
                "id": "345287",
                "name": "Basel Bad Bf",
                "coordinates": {
                  "latitude": 47.567287,
                  "longitude": 7.607805
                }
              },
              "arrivalTime": "2024-09-25T06:56:00",
              "departureTime": "2024-09-25T07:11:00"
            },
            {
              "stop": {
                "id": "558791",
                "name": "Basel SBB",
                "coordinates": {
                  "latitude": 47.547405,
                  "longitude": 7.589551
                }
              },
              "arrivalTime": "2024-09-25T07:20:00",
              "departureTime": "2024-09-25T07:20:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 47.547405,
          "longitude": 7.589551
        },
        "to": {
          "latitude": 47.378178,
          "longitude": 8.540212
        },
        "fromStop": {
          "id": "558791",
          "name": "Basel SBB",
          "coordinates": {
            "latitude": 47.547405,
            "longitude": 7.589551
          }
        },
        "toStop": {
          "id": "32861",
          "name": "Zürich HB",
          "coordinates": {
            "latitude": 47.378178,
            "longitude": 8.540212
          }
        },
        "departureTime": "2024-09-25T08:06:00",
        "arrivalTime": "2024-09-25T09:00:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "7533",
            "name": "",
            "shortName": "ICE",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "558791",
                "name": "Basel SBB",
                "coordinates": {
                  "latitude": 47.547405,
                  "longitude": 7.589551
                }
              },
              "arrivalTime": "2024-09-25T08:06:00",
              "departureTime": "2024-09-25T08:06:00"
            },
            {
              "stop": {
                "id": "32861",
                "name": "Zürich HB",
                "coordinates": {
                  "latitude": 47.378178,
                  "longitude": 8.540212
                }
              },
              "arrivalTime": "2024-09-25T09:00:00",
              "departureTime": "2024-09-25T09:00:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 47.378178,
          "longitude": 8.540212
        },
        "to": {
          "latitude": 47.450386,
          "longitude": 8.562402
        },
        "fromStop": {
          "id": "32861",
          "name": "Zürich HB",
          "coordinates": {
            "latitude": 47.378178,
            "longitude": 8.540212
          }
        },
        "toStop": {
          "id": "504562",
          "name": "Zürich Flughafen",
          "coordinates": {
            "latitude": 47.450386,
            "longitude": 8.562402
          }
        },
        "departureTime": "2024-09-25T09:33:00",
        "arrivalTime": "2024-09-25T09:41:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "6962",
            "name": "EuroCity",
            "shortName": "EC 88",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "32861",
                "name": "Zürich HB",
                "coordinates": {
                  "latitude": 47.378178,
                  "longitude": 8.540212
                }
              },
              "arrivalTime": "2024-09-25T09:33:00",
              "departureTime": "2024-09-25T09:33:00"
            },
            {
              "stop": {
                "id": "504562",
                "name": "Zürich Flughafen",
                "coordinates": {
                  "latitude": 47.450386,
                  "longitude": 8.562402
                }
              },
              "arrivalTime": "2024-09-25T09:41:00",
              "departureTime": "2024-09-25T09:43:00"
            },
            {
              "stop": {
                "id": "262518",
                "name": "Winterthur",
                "coordinates": {
                  "latitude": 47.500336,
                  "longitude": 8.723821
                }
              },
              "arrivalTime": "2024-09-25T09:57:00",
              "departureTime": "2024-09-25T09:58:00"
            },
            {
              "stop": {
                "id": "218574",
                "name": "St. Gallen(CH)",
                "coordinates": {
                  "latitude": 47.42318,
                  "longitude": 9.369897
                }
              },
              "arrivalTime": "2024-09-25T10:30:00",
              "departureTime": "2024-09-25T10:32:00"
            },
            {
              "stop": {
                "id": "293972",
                "name": "St. Margrethen SG",
                "coordinates": {
                  "latitude": 47.453217,
                  "longitude": 9.638262
                }
              },
              "arrivalTime": "2024-09-25T10:49:00",
              "departureTime": "2024-09-25T10:49:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      }
    ]
  },
  {
    "legs": [
      {
        "type": "ROUTE",
        "from": {
          "latitude": 52.503067,
          "longitude": 13.469961
        },
        "to": {
          "latitude": 52.54869,
          "longitude": 13.390501
        },
        "fromStop": {
          "id": "651634",
          "name": "Berlin Ostkreuz",
          "coordinates": {
            "latitude": 52.503067,
            "longitude": 13.469961
          }
        },
        "toStop": {
          "id": "142231",
          "name": "Berlin Gesundbrunnen",
          "coordinates": {
            "latitude": 52.54869,
            "longitude": 13.390501
          }
        },
        "departureTime": "2024-09-24T14:48:00",
        "arrivalTime": "2024-09-24T14:56:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "2161",
            "name": "",
            "shortName": "FEX",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "352804",
                "name": "Flughafen BER",
                "coordinates": {
                  "latitude": 52.364063,
                  "longitude": 13.509307
                }
              },
              "arrivalTime": "2024-09-24T14:28:00",
              "departureTime": "2024-09-24T14:28:00"
            },
            {
              "stop": {
                "id": "414873",
                "name": "Berlin-Schöneweide",
                "coordinates": {
                  "latitude": 52.45469,
                  "longitude": 13.509638
                }
              },
              "arrivalTime": "2024-09-24T14:40:00",
              "departureTime": "2024-09-24T14:40:00"
            },
            {
              "stop": {
                "id": "651634",
                "name": "Berlin Ostkreuz",
                "coordinates": {
                  "latitude": 52.503067,
                  "longitude": 13.469961
                }
              },
              "arrivalTime": "2024-09-24T14:46:00",
              "departureTime": "2024-09-24T14:48:00"
            },
            {
              "stop": {
                "id": "142231",
                "name": "Berlin Gesundbrunnen",
                "coordinates": {
                  "latitude": 52.54869,
                  "longitude": 13.390501
                }
              },
              "arrivalTime": "2024-09-24T14:56:00",
              "departureTime": "2024-09-24T14:58:00"
            },
            {
              "stop": {
                "id": "98012",
                "name": "Berlin Hbf",
                "coordinates": {
                  "latitude": 52.525143,
                  "longitude": 13.369612
                }
              },
              "arrivalTime": "2024-09-24T15:03:00",
              "departureTime": "2024-09-24T15:03:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 52.54869,
          "longitude": 13.390501
        },
        "to": {
          "latitude": 49.445618,
          "longitude": 11.082989
        },
        "fromStop": {
          "id": "142231",
          "name": "Berlin Gesundbrunnen",
          "coordinates": {
            "latitude": 52.54869,
            "longitude": 13.390501
          }
        },
        "toStop": {
          "id": "200315",
          "name": "Nürnberg Hbf",
          "coordinates": {
            "latitude": 49.445618,
            "longitude": 11.082989
          }
        },
        "departureTime": "2024-09-24T15:51:00",
        "arrivalTime": "2024-09-24T18:56:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "7746",
            "name": "Intercity-Express",
            "shortName": "ICE 29",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "142231",
                "name": "Berlin Gesundbrunnen",
                "coordinates": {
                  "latitude": 52.54869,
                  "longitude": 13.390501
                }
              },
              "arrivalTime": "2024-09-24T15:51:00",
              "departureTime": "2024-09-24T15:51:00"
            },
            {
              "stop": {
                "id": "449043",
                "name": "Berlin Hbf",
                "coordinates": {
                  "latitude": 52.524998,
                  "longitude": 13.369061
                }
              },
              "arrivalTime": "2024-09-24T15:56:00",
              "departureTime": "2024-09-24T16:11:00"
            },
            {
              "stop": {
                "id": "200315",
                "name": "Nürnberg Hbf",
                "coordinates": {
                  "latitude": 49.445618,
                  "longitude": 11.082989
                }
              },
              "arrivalTime": "2024-09-24T18:56:00",
              "departureTime": "2024-09-24T18:59:00"
            },
            {
              "stop": {
                "id": "85459",
                "name": "München Hbf",
                "coordinates": {
                  "latitude": 48.140812,
                  "longitude": 11.557644
                }
              },
              "arrivalTime": "2024-09-24T20:02:00",
              "departureTime": "2024-09-24T20:02:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 49.445618,
          "longitude": 11.082989
        },
        "to": {
          "latitude": 48.36544,
          "longitude": 10.88557
        },
        "fromStop": {
          "id": "200315",
          "name": "Nürnberg Hbf",
          "coordinates": {
            "latitude": 49.445618,
            "longitude": 11.082989
          }
        },
        "toStop": {
          "id": "641510",
          "name": "Augsburg Hbf",
          "coordinates": {
            "latitude": 48.36544,
            "longitude": 10.88557
          }
        },
        "departureTime": "2024-09-24T18:59:00",
        "arrivalTime": "2024-09-24T20:09:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "20154",
            "name": "Intercity-Express",
            "shortName": "ICE 18",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "548094",
                "name": "Hamburg-Altona",
                "coordinates": {
                  "latitude": 53.55281,
                  "longitude": 9.934828
                }
              },
              "arrivalTime": "2024-09-24T12:19:00",
              "departureTime": "2024-09-24T12:19:00"
            },
            {
              "stop": {
                "id": "516013",
                "name": "Hamburg Dammtor",
                "coordinates": {
                  "latitude": 53.560757,
                  "longitude": 9.989569
                }
              },
              "arrivalTime": "2024-09-24T12:27:00",
              "departureTime": "2024-09-24T12:28:00"
            },
            {
              "stop": {
                "id": "595684",
                "name": "Hamburg Hbf",
                "coordinates": {
                  "latitude": 53.552322,
                  "longitude": 10.006657
                }
              },
              "arrivalTime": "2024-09-24T12:33:00",
              "departureTime": "2024-09-24T12:37:00"
            },
            {
              "stop": {
                "id": "561120",
                "name": "Hamburg-Harburg",
                "coordinates": {
                  "latitude": 53.45619,
                  "longitude": 9.991359
                }
              },
              "arrivalTime": "2024-09-24T12:52:00",
              "departureTime": "2024-09-24T12:54:00"
            },
            {
              "stop": {
                "id": "234346",
                "name": "Uelzen",
                "coordinates": {
                  "latitude": 52.969837,
                  "longitude": 10.55279
                }
              },
              "arrivalTime": "2024-09-24T13:33:00",
              "departureTime": "2024-09-24T13:34:00"
            },
            {
              "stop": {
                "id": "104729",
                "name": "Salzwedel",
                "coordinates": {
                  "latitude": 52.858112,
                  "longitude": 11.162035
                }
              },
              "arrivalTime": "2024-09-24T14:08:00",
              "departureTime": "2024-09-24T14:09:00"
            },
            {
              "stop": {
                "id": "15440",
                "name": "Stendal Hbf",
                "coordinates": {
                  "latitude": 52.594723,
                  "longitude": 11.854412
                }
              },
              "arrivalTime": "2024-09-24T14:35:00",
              "departureTime": "2024-09-24T14:36:00"
            },
            {
              "stop": {
                "id": "552581",
                "name": "Berlin-Spandau",
                "coordinates": {
                  "latitude": 52.534542,
                  "longitude": 13.197124
                }
              },
              "arrivalTime": "2024-09-24T15:11:00",
              "departureTime": "2024-09-24T15:13:00"
            },
            {
              "stop": {
                "id": "269571",
                "name": "Berlin Hbf",
                "coordinates": {
                  "latitude": 52.52496,
                  "longitude": 13.368911
                }
              },
              "arrivalTime": "2024-09-24T15:21:00",
              "departureTime": "2024-09-24T15:34:00"
            },
            {
              "stop": {
                "id": "441032",
                "name": "Bitterfeld",
                "coordinates": {
                  "latitude": 51.62286,
                  "longitude": 12.31685
                }
              },
              "arrivalTime": "2024-09-24T16:32:00",
              "departureTime": "2024-09-24T16:33:00"
            },
            {
              "stop": {
                "id": "117818",
                "name": "Halle(Saale)Hbf",
                "coordinates": {
                  "latitude": 51.47751,
                  "longitude": 11.987085
                }
              },
              "arrivalTime": "2024-09-24T16:50:00",
              "departureTime": "2024-09-24T16:52:00"
            },
            {
              "stop": {
                "id": "60016",
                "name": "Erfurt Hbf",
                "coordinates": {
                  "latitude": 50.972355,
                  "longitude": 11.037993
                }
              },
              "arrivalTime": "2024-09-24T17:24:00",
              "departureTime": "2024-09-24T17:32:00"
            },
            {
              "stop": {
                "id": "198678",
                "name": "Bamberg",
                "coordinates": {
                  "latitude": 49.90076,
                  "longitude": 10.899489
                }
              },
              "arrivalTime": "2024-09-24T18:15:00",
              "departureTime": "2024-09-24T18:17:00"
            },
            {
              "stop": {
                "id": "200315",
                "name": "Nürnberg Hbf",
                "coordinates": {
                  "latitude": 49.445618,
                  "longitude": 11.082989
                }
              },
              "arrivalTime": "2024-09-24T18:52:00",
              "departureTime": "2024-09-24T18:59:00"
            },
            {
              "stop": {
                "id": "234949",
                "name": "Donauwörth",
                "coordinates": {
                  "latitude": 48.714027,
                  "longitude": 10.771443
                }
              },
              "arrivalTime": "2024-09-24T19:48:00",
              "departureTime": "2024-09-24T19:50:00"
            },
            {
              "stop": {
                "id": "641510",
                "name": "Augsburg Hbf",
                "coordinates": {
                  "latitude": 48.36544,
                  "longitude": 10.88557
                }
              },
              "arrivalTime": "2024-09-24T20:09:00",
              "departureTime": "2024-09-24T20:10:00"
            },
            {
              "stop": {
                "id": "378825",
                "name": "Pasing",
                "coordinates": {
                  "latitude": 48.149197,
                  "longitude": 11.459296
                }
              },
              "arrivalTime": "2024-09-24T20:33:00",
              "departureTime": "2024-09-24T20:34:00"
            },
            {
              "stop": {
                "id": "136363",
                "name": "München Hbf",
                "coordinates": {
                  "latitude": 48.140182,
                  "longitude": 11.557527
                }
              },
              "arrivalTime": "2024-09-24T20:43:00",
              "departureTime": "2024-09-24T20:43:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 48.36544,
          "longitude": 10.88557
        },
        "to": {
          "latitude": 47.552383,
          "longitude": 9.703292
        },
        "fromStop": {
          "id": "641510",
          "name": "Augsburg Hbf",
          "coordinates": {
            "latitude": 48.36544,
            "longitude": 10.88557
          }
        },
        "toStop": {
          "id": "472781",
          "name": "Lindau-Reutin",
          "coordinates": {
            "latitude": 47.552383,
            "longitude": 9.703292
          }
        },
        "departureTime": "2024-09-24T20:32:00",
        "arrivalTime": "2024-09-24T22:50:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "4194",
            "name": "",
            "shortName": "RE7",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "641510",
                "name": "Augsburg Hbf",
                "coordinates": {
                  "latitude": 48.36544,
                  "longitude": 10.88557
                }
              },
              "arrivalTime": "2024-09-24T20:32:00",
              "departureTime": "2024-09-24T20:32:00"
            },
            {
              "stop": {
                "id": "384347",
                "name": "Augsburg Morellstr.",
                "coordinates": {
                  "latitude": 48.355087,
                  "longitude": 10.892948
                }
              },
              "arrivalTime": "2024-09-24T20:35:00",
              "departureTime": "2024-09-24T20:35:00"
            },
            {
              "stop": {
                "id": "226763",
                "name": "Augsburg Messe",
                "coordinates": {
                  "latitude": 48.338684,
                  "longitude": 10.886086
                }
              },
              "arrivalTime": "2024-09-24T20:38:00",
              "departureTime": "2024-09-24T20:39:00"
            },
            {
              "stop": {
                "id": "371959",
                "name": "Inningen",
                "coordinates": {
                  "latitude": 48.311337,
                  "longitude": 10.868876
                }
              },
              "arrivalTime": "2024-09-24T20:41:00",
              "departureTime": "2024-09-24T20:42:00"
            },
            {
              "stop": {
                "id": "592890",
                "name": "Bobingen",
                "coordinates": {
                  "latitude": 48.266373,
                  "longitude": 10.837891
                }
              },
              "arrivalTime": "2024-09-24T20:46:00",
              "departureTime": "2024-09-24T20:47:00"
            },
            {
              "stop": {
                "id": "443860",
                "name": "Schwabmünchen",
                "coordinates": {
                  "latitude": 48.178688,
                  "longitude": 10.768291
                }
              },
              "arrivalTime": "2024-09-24T20:53:00",
              "departureTime": "2024-09-24T20:54:00"
            },
            {
              "stop": {
                "id": "622150",
                "name": "Buchloe",
                "coordinates": {
                  "latitude": 48.033722,
                  "longitude": 10.716217
                }
              },
              "arrivalTime": "2024-09-24T21:05:00",
              "departureTime": "2024-09-24T21:07:00"
            },
            {
              "stop": {
                "id": "290964",
                "name": "Kaufbeuren",
                "coordinates": {
                  "latitude": 47.87543,
                  "longitude": 10.629496
                }
              },
              "arrivalTime": "2024-09-24T21:17:00",
              "departureTime": "2024-09-24T21:18:00"
            },
            {
              "stop": {
                "id": "200544",
                "name": "Biessenhofen",
                "coordinates": {
                  "latitude": 47.829956,
                  "longitude": 10.640467
                }
              },
              "arrivalTime": "2024-09-24T21:22:00",
              "departureTime": "2024-09-24T21:22:00"
            },
            {
              "stop": {
                "id": "415089",
                "name": "Günzach",
                "coordinates": {
                  "latitude": 47.8196,
                  "longitude": 10.439565
                }
              },
              "arrivalTime": "2024-09-24T21:32:00",
              "departureTime": "2024-09-24T21:33:00"
            },
            {
              "stop": {
                "id": "156850",
                "name": "Kempten(Allgäu)Hbf",
                "coordinates": {
                  "latitude": 47.711746,
                  "longitude": 10.31761
                }
              },
              "arrivalTime": "2024-09-24T21:43:00",
              "departureTime": "2024-09-24T21:45:00"
            },
            {
              "stop": {
                "id": "545571",
                "name": "Martinszell(Allgäu)",
                "coordinates": {
                  "latitude": 47.629406,
                  "longitude": 10.273885
                }
              },
              "arrivalTime": "2024-09-24T21:51:00",
              "departureTime": "2024-09-24T21:52:00"
            },
            {
              "stop": {
                "id": "34764",
                "name": "Immenstadt",
                "coordinates": {
                  "latitude": 47.559204,
                  "longitude": 10.213999
                }
              },
              "arrivalTime": "2024-09-24T22:01:00",
              "departureTime": "2024-09-24T22:03:00"
            },
            {
              "stop": {
                "id": "634062",
                "name": "Oberstaufen",
                "coordinates": {
                  "latitude": 47.554207,
                  "longitude": 10.025285
                }
              },
              "arrivalTime": "2024-09-24T22:13:00",
              "departureTime": "2024-09-24T22:14:00"
            },
            {
              "stop": {
                "id": "327321",
                "name": "Röthenbach(Allgäu)",
                "coordinates": {
                  "latitude": 47.620617,
                  "longitude": 9.953543
                }
              },
              "arrivalTime": "2024-09-24T22:23:00",
              "departureTime": "2024-09-24T22:24:00"
            },
            {
              "stop": {
                "id": "475510",
                "name": "Heimenkirch",
                "coordinates": {
                  "latitude": 47.62891,
                  "longitude": 9.9021
                }
              },
              "arrivalTime": "2024-09-24T22:27:00",
              "departureTime": "2024-09-24T22:28:00"
            },
            {
              "stop": {
                "id": "288780",
                "name": "Hergatz",
                "coordinates": {
                  "latitude": 47.64681,
                  "longitude": 9.827382
                }
              },
              "arrivalTime": "2024-09-24T22:34:00",
              "departureTime": "2024-09-24T22:35:00"
            },
            {
              "stop": {
                "id": "472781",
                "name": "Lindau-Reutin",
                "coordinates": {
                  "latitude": 47.552383,
                  "longitude": 9.703292
                }
              },
              "arrivalTime": "2024-09-24T22:50:00",
              "departureTime": "2024-09-24T22:50:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 47.552383,
          "longitude": 9.703292
        },
        "to": {
          "latitude": 47.453217,
          "longitude": 9.638262
        },
        "fromStop": {
          "id": "472781",
          "name": "Lindau-Reutin",
          "coordinates": {
            "latitude": 47.552383,
            "longitude": 9.703292
          }
        },
        "toStop": {
          "id": "293972",
          "name": "St. Margrethen SG",
          "coordinates": {
            "latitude": 47.453217,
            "longitude": 9.638262
          }
        },
        "departureTime": "2024-09-25T05:52:00",
        "arrivalTime": "2024-09-25T06:09:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "595",
            "name": "7",
            "shortName": "RE",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "472781",
                "name": "Lindau-Reutin",
                "coordinates": {
                  "latitude": 47.552383,
                  "longitude": 9.703292
                }
              },
              "arrivalTime": "2024-09-25T05:52:00",
              "departureTime": "2024-09-25T05:52:00"
            },
            {
              "stop": {
                "id": "198363",
                "name": "Bregenz",
                "coordinates": {
                  "latitude": 47.503002,
                  "longitude": 9.739627
                }
              },
              "arrivalTime": "2024-09-25T05:59:00",
              "departureTime": "2024-09-25T06:00:00"
            },
            {
              "stop": {
                "id": "293972",
                "name": "St. Margrethen SG",
                "coordinates": {
                  "latitude": 47.453217,
                  "longitude": 9.638262
                }
              },
              "arrivalTime": "2024-09-25T06:09:00",
              "departureTime": "2024-09-25T06:09:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      },
      {
        "type": "ROUTE",
        "from": {
          "latitude": 47.453217,
          "longitude": 9.638262
        },
        "to": {
          "latitude": 47.450386,
          "longitude": 8.562402
        },
        "fromStop": {
          "id": "293972",
          "name": "St. Margrethen SG",
          "coordinates": {
            "latitude": 47.453217,
            "longitude": 9.638262
          }
        },
        "toStop": {
          "id": "504562",
          "name": "Zürich Flughafen",
          "coordinates": {
            "latitude": 47.450386,
            "longitude": 8.562402
          }
        },
        "departureTime": "2024-09-25T07:10:00",
        "arrivalTime": "2024-09-25T08:16:00",
        "trip": {
          "headSign": "",
          "route": {
            "id": "12637",
            "name": "",
            "shortName": "EC",
            "transportMode": "RAIL",
            "transportModeDescription": "Rail. Used for intercity or long-distance travel."
          },
          "stopTimes": [
            {
              "stop": {
                "id": "293972",
                "name": "St. Margrethen SG",
                "coordinates": {
                  "latitude": 47.453217,
                  "longitude": 9.638262
                }
              },
              "arrivalTime": "2024-09-25T07:10:00",
              "departureTime": "2024-09-25T07:10:00"
            },
            {
              "stop": {
                "id": "218574",
                "name": "St. Gallen(CH)",
                "coordinates": {
                  "latitude": 47.42318,
                  "longitude": 9.369897
                }
              },
              "arrivalTime": "2024-09-25T07:28:00",
              "departureTime": "2024-09-25T07:29:00"
            },
            {
              "stop": {
                "id": "262518",
                "name": "Winterthur",
                "coordinates": {
                  "latitude": 47.500336,
                  "longitude": 8.723821
                }
              },
              "arrivalTime": "2024-09-25T08:01:00",
              "departureTime": "2024-09-25T08:03:00"
            },
            {
              "stop": {
                "id": "504562",
                "name": "Zürich Flughafen",
                "coordinates": {
                  "latitude": 47.450386,
                  "longitude": 8.562402
                }
              },
              "arrivalTime": "2024-09-25T08:16:00",
              "departureTime": "2024-09-25T08:18:00"
            },
            {
              "stop": {
                "id": "32861",
                "name": "Zürich HB",
                "coordinates": {
                  "latitude": 47.378178,
                  "longitude": 8.540212
                }
              },
              "arrivalTime": "2024-09-25T08:27:00",
              "departureTime": "2024-09-25T08:27:00"
            }
          ],
          "bikesAllowed": false,
          "wheelchairAccessible": false
        }
      }
    ]
  }
]

Copy link
Member

@clukas1 clukas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my getStringFieldOrDefault method could be reused :). Looks good from my side.

@munterfi munterfi merged commit 77454d2 into main Sep 24, 2024
2 checks passed
@munterfi munterfi deleted the bugfix/NAV-193-headsign-is-an-optinal-field branch September 24, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants