This was caused by a small walking section in the route. This is a walking section between Haren and Haren-zuid, 2 stations at a few hundred meters from each other, it would be one station if the tracks were a bit closer together. However, this means it's a valid route, and we can't drop it just because it has a walking part.
I fixed the API to support this, however, in the via's this registers as a train with direction 'WALK' and an id of 'WALK'. I don't know how applications are going to respond to this, and this not definitive. However since it didn't work before anyway, this might be a good temporary fix, and this needs more discussion with other team members like @pietercolpaert who's not available this week.
I added a walking flag to via arrivals and departures. This flag could be used to distinguish a short walk like this from a train. While not definitive, I'm pretty sure the flag's going to stay for things like this. If you already want to support this, I suggest to do the following for now:
Check for presence of this flag. Use a try-catch or validate the presence, but don't rely on it being there.
If present and set, treat as walking
If not present or not set, treat as train
Edit: just tested, BeTrains works fine already with the current fix. I suggest you keep it like this until we have a definitive implementation for walking support.
The definitive fix for this is the walking flag, which has been added to every arrival and departure. This flag is the only reliable way to detect if the part after this departure or before this arrival is a walking part. Any other fields, like the direction and id of the train should be ignored (do not try to parse or read these fields in this case). Future updates might add the walking time in this field. Therefore I recommend you use the following test: walking == 0 means it's a train (non-walking). walking > 0 means it's a walking part.
The documentation will be updated with new fields and information once everything is final.
Sorry,I am on mobile, so I cannot give more information, but I got this report and I can confirm.
Irail.be also show an error.
Link: https://api.irail.be/connections/?from=aarschot&to=meiser and also happening with &format=json
There seems to be some results concatenated with the error 500 message.
The text was updated successfully, but these errors were encountered: