ListObjectVersions response does not retain order of versions and delete markers
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 51
Description
The response to a [ListObjectVersions](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html) request consists of a sequence of `Version` and `DeleteMarker` tags. The examples show that these are returned in (object key, version id) order with `Version`s and `DeleteMarker`s interleaved.
The v1 SDK makes this data accessible as a single `List` of `S3VersionSummary` objects. The latter can represent either a `Version` or a `DeleteMarker` value. This way no information is lost regarding the ordering of the tags in the XML response.
The v2 SDK on the other hand splits this into two `List`s: one for `Version`s and for `DeleteMarker`s. As a consequence the relative ordering of the elements from the XML response is lost.
## Expected Behavior
The SDK provides an object model that provides a representation of the underlying XML data that matches the XML data as close as possible. Having to reconstruct the tag ordering in client code by grouping on object key and then sorting on timestamps while the response was already in exactly this order is unnecessary overhead.
## Current Behavior
`Version`s and `DeleteMarker`s are returned as two distinct lists.
## Possible Solution
Mimic the v1 object model.
## Steps to Reproduce (for bugs)
N/A
Contributor guide
Assessment
This issue has not been assessed yet.