Closed adam-fowler closed 3 years ago
I'm not aware of any API where the IsTruncated
style parameter is necessary for pagination. If there aren't more results, the NextToken/NextMarker/etc member on output is supposed to be omitted. There are some other things that SDKs do as well to account for tail-style APIs, for example if they get the same token twice in a row they stop paginating.
The API I mention above S3.ListParts does exactly that. It will return a nextToken when there are no more results but also returns isTruncated set to false.
I guess checking for the same token being returned twice might be a solution in this case. I would have to verify that for S3.ListParts.
Actually S3.ListParts pagination is not available in the Smithy files in the aws-sdk-go-v2 repo but it is available in the old style json models. I know this doesn't necessarily mean anything but thought it was worth noting.
Because moreResults is no longer needed for pagination, I'll go ahead and resolve this issue.
I had a look at using the same token in a row method for S3.ListMultipartUploads
and it doesn't work. It just resets to the beginning of the list again.
I don't think this is resolved.
EDIT: Wrong method, I meant S3.ListParts()
@mtdowling See https://github.com/aws/aws-sdk-go-v2/pull/1141
A number of paginated AWS operations indicate there are more results via a boolean and not whether an "outputToken" is returned. See https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html where the existence of more results is indicated via a
IsTruncated
value in the response.The paginated trait does not provide support for this.