Closed barbeau closed 7 years ago
Currently, the server version is already requested in the ServerChecker. Depending on the version, the api version parameter is stored in the preferences, which would be natural to reuse. As the API version seems to be a concept introduced by otp-for-android and not an official otp value, it could be incremented to reflect this (and perhaps further?) changes in OTP v1.0.
However, current uses of the OTPApp.PREFERENCE_KEY_API_VERSION explicitly compare to version 1 and would need to be adapted, if a new version should be introduced.
Think this would be the best option compared to doing trial and error requests for multiple urls, accessing the server info here again or introducing a new preference value for the server version.
The metadata endpoint was removed in otp with commit ac1f29c ("Removed GraphMetadata API point", 2015-06-05), so any otp server version equal to or greater than 0.19 will suffer from this issue.
@hbruch Thanks! You're correct, looks like this affects 0.19 and above.
Also, I believe this only affects when a server is entered as a custom API - I believe we use the bounds from the OTP Server Directory for those servers.
Looks like the OTP server v0.19.0 release changed the location of the
/metadata
endpoint: https://github.com/opentripplanner/OpenTripPlanner/commit/e32de4266a360f278ccc10320d4df13aa5ee2e52It used to be this: https://mobullity.forest.usf.edu/otp/routers/default/metadata
Response:
There isn't a
/metadata
endpoint in v1.0, but the/routers/default/
seems to return the same info.Request: http://api.mfdz.de/otp/routers/default
Response:
I guess we should change to trying the root first (assuming most people going forward will be using v1.0 or later), and then fall back to
/metadata
if the root fails.We could also hit the main
/otp
endpoint and get the server version there: http://api.mfdz.de/otp/Response: