tzemanovic / haskell-yesod-realworld-example-app

Exemplary real world application built with Haskell + Yesod
https://realworld.io
BSD 3-Clause "New" or "Revised" License
169 stars 26 forks source link

json data `createdAt` and `updatedAt` is not compliant with API's iso-8601 date format #2

Closed digitalsatori closed 6 years ago

digitalsatori commented 6 years ago

running Api provided run-api-tests.sh script and got AssertionError for the date format. I guess this is the related aeson issue: https://github.com/bos/aeson/issues/620

tzemanovic commented 6 years ago

Yep, the tests fail despite the timestamps having a ISO-8601 format.

I've opened a PR to improve the tests https://github.com/gothinkster/realworld/pull/260, with these changes the tests do pass. Previously, they were just converting them to JS Date and back using toISOString, but that removes the extra precision and hence don't match the originals.

digitalsatori commented 6 years ago

Thanks for the explaination. just realized that ISO-8601 can represent datetime with arbitrary precision. The one generated by your system is totally valid in terms of ISO-8601 format.