samuel-pratt / bc-ferries-api

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

ISO8601 format for scrapedAt #34

Closed pbadams closed 8 months ago

pbadams commented 1 year ago

I'm looking to build a JSON Schema for the API. This will help others build language wrappers for the returned JSON.

I'm hitting a JSON Schema validation error on scrapedAt because it's not strict ISO8601 format. It appears scrapedAt is way to precise, with too many microseconds. My current workaround to define scrapedAt as a string in the schema, but that defeats the purpose of strict typing and will make language wrapping a little harder.

Any chance of updating the code to adhere to strict ISO8601 for where possible?

pbadams commented 1 year ago

This library might be a viable solution: https://github.com/relvacode/iso8601

samuel-pratt commented 1 year ago

Switching over form a string to ISO8601 makes sense to me, I'll start on that now.

samuel-pratt commented 8 months ago

Forgot to close this before, this was added in this commit: https://github.com/samuel-pratt/bc-ferries-api/commit/990cf650b36398a05865243e961ecae98e551fa1