samuel-pratt / bc-ferries-api

🛳 The only public API for retrieving current data on BC Ferries sailings.
https://bcferriesapi.ca
MIT License
33 stars 11 forks source link

Inconsistent time formats and bad string data in "arrivalTime" #44

Closed pbadams closed 1 month ago

pbadams commented 8 months ago

Hi,

I've written a JSON Schema for the V2 API (See PR 43). When I use it against JSON returned from the V2 end point it fails due to:

This had been tested using the following JSON validators:

While this is not a big issue for apps that only use the time fields as display strings, it is problematic for consuming apps that need a consistent time format so they can reliably convert the time elements into native Datetime objects in their preferred language.

samuel-pratt commented 8 months ago

Thanks for raising this, I'll take a look.

Do you know what conditions cause Sailingsonly to appear in the JSON so I can test it? What I'm thinking is I'm just going to add a regex match to the arrivalTime so it pulls the timestamp out if there is a longer string.

samuel-pratt commented 1 month ago

PR looked good to me, closing this issue. Sorry for the slow turnaround on review.