-
Notifications
You must be signed in to change notification settings - Fork 32
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
Make BrAPI Lists Ordered #615
Comments
An example of transparently maintaining the ordering of BrAPI lists can be seen here in Breeding Insight's fork of the BrAPI-Java-TestServer. |
hmmm I'm not sure I see the argument for adding an explicit |
I see your point. I thought of a case where adding an explicit
I realize that's a little contrived, but it does make me think that if the documentation is changed to recommend that implementations preserve order, it would be worth describing the recommended behavior of the /lists/{listDbId}/data POST endpoint specifically as well. I think append is the most natural behavior. |
Feature Request
@BrapiCoordinatorSelby I think BrAPI lists serve the most use cases if they are ordered lists. Currently, there is nothing in the spec that requires ordering to be preserved. The BrAPI-Java-TestServer generally returns list items in the same order they were created in, but this is only due to the default order in which PostgreSQL returns rows when an ORDER BY clause is omitted and is not guaranteed by any means.
Possible Implementations
Adopt UUID v7
Version 7 UUIDs are time-sortable, the first 48 bits are a timestamp with millisecond precision. For entities created by the same system in the same millisecond, implementations usually use an increasing counter to ensure monotonicity within each millisecond as well.
Pros
Cons
Add Field(s) to List Items
Adding a created timestamp and/or an integer list position field to list items could work in at least two ways. (1) The new field could be added to the API spec and explicitly passed back and forth when creating and reading lists (an integer position would make sense in this case) or (2) it could be a means of transparently preserving the original order of the list (a timestamp would be suitable in this case).
Pros
Cons
The text was updated successfully, but these errors were encountered: