-
-
Notifications
You must be signed in to change notification settings - Fork 314
Added last_updated to /v2/latest
#81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also added source info field
ExpDev07
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn’t really give the last updates, it’ll just say whatever time is the endpoint is accessed. Also, to comply with the JSON-API spec, should perhaps this information be put under a “meta” key?
|
Is it possible to get the time of the last update? If so I think that would be preferable. We could put it under a meta key, but I feel like that's rather unnecessary for just 1-2 keys--plus, that doesn't conform to the v1 API. Either way works, but I just think it should be consistent (and backward-compatible so it doesn't break workflows). |
|
The point of the /v2/ was to introduce major changes. We just have to stay compatible with the current v2 endpoints and not v1 (they are now undocumented but staying for legacy support and not to break apps). And yes, it’s possible. You can go into the timeline.py, and add a computed field which just grabs the latest key in the timelines property dict (see latest). Then you just gotta make sure to add it to the serialization method dict. |
|
Oops, I meant timeline.py, not location. The last_update would technically be apart of the timelines. However, I agree that it would be better having it attached to the actual location object, in which case we can just store the time when the data was last retrieved from JHU. Either way works, but which one is the best, idk. |
|
Alright, then adding the meta key is the way to go. I looked at the return data from the timelines property, but the timestamp is always at midnight GMT, which isn't really useful. However, the |
|
Yup, it’s always midnight. JHU updates their data only once a day anyways. |
|
Will be adding a similar feature, hopefully soon. |
Also added source info field