derhuerst / db-rest

A clean REST API wrapping around the Deutsche Bahn API.
https://v6.db.transport.rest/
ISC License
79 stars 9 forks source link

v6: pagination not working due to realtime routing #31

Open debfx opened 1 year ago

debfx commented 1 year ago

Pagination doesn't seem to be working with API v6.

For example https://v6.db.transport.rest/journeys?from=8096021&to=8000085&departure=2023-08-01 returns 3 results with the latest departure at 04:46.

Still both earlierRef and laterRef are null so it's not possible to do follow-up request for the next results.

API v5 https://v5.db.transport.rest/journeys?from=8096021&to=8000085&departure=2023-08-01 returns working earlierRef and laterRef.

derhuerst commented 1 year ago

In hafas-client, the HAFAS client underlying v6.db.transport.rest & v5.db.transport.rest, I have changed the default rtMode (routing mode of the HAFAS engine) from "hybrid" routing to "realtime" routing: https://github.com/public-transport/hafas-client/commit/3c17678d. This change has been done in hafas-client@6 only, so that explains why the pagination is only broken in v6.db.transport.rest.

The ticket in the hafas-client repo proposes adding an option to hafas-clients's journey() method, which could then be exposed here in db-rest. Then, we should also clearly document the effects of the realtimeRouting option.

TLDR: blocked by https://github.com/public-transport/hafas-client/issues/287

derhuerst commented 12 months ago

I have published the fix (#295) as hafas-client@6.1.0. 🎉

https://github.com/public-transport/hafas-client/issues/287#issuecomment-1649929463

This is unblocked now. What needs to be done here:

dancojocaru2000 commented 10 months ago

Is there work in progress for this? If not, I might try looking into it, since it's affecting my usecase.

derhuerst commented 5 months ago

Is there work in progress for this?

None that I know of.