-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Consistent use of date- and time-related types in endpoint responses #10976
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
Comments
I was just about to open a similar issue, to consider harmonizing the date/time related types between Perhaps it should also be considered to use I generally find this set of recommendations useful as a guide for addressing date/time related concerns while building an API. |
We're thinking |
In the interests of being relaxed about what we accept and strict about what we produce, I think the endpoints should consume |
As part of this, we should ensure that any |
@wilkinsona |
Thanks for the catch, @joshiste. |
Uh oh!
There was an error while loading. Please reload this page.
The endpoints are currently inconsistent in the types that they use for date and time-related types in their responses. For example, the sessions endpoint uses
long
forcreationTime
andlastAccessedTime
whereas the info endpoint uses aDate
for the git info'scommit.time
andbuild.time
.An advantage of using a
Date
is that the format can then be controlled by the user via Jackson's serialisation configuration. An advantage of using along
is that the format doesn't change making it easier to document. Whichever way we go, we should try to make all of the endpoints consistent.It's worth noting that when consuming a date-like type, the endpoint infrastructure requires the use of ISO 8601 offset date times. Aligning with that (thereby making the formats used in requests and responses consistent) is another option to consider.
The text was updated successfully, but these errors were encountered: