boto3
boto3 copied to clipboard
Documentation Error: S3 Paginator list_objects_v2 NextToken
The Response Syntax and Response Structure for the paginator list_objects_v2 (https://boto3.readthedocs.io/en/develop/reference/services/s3.html#S3.Paginator.ListObjectsV2) has the NextToken as part of the response, however list_objects_v2 actually returns NextContinuationToken. The list_objects_v2 client properly has this defined, but not the paginator.
It's actually possible to sometimes get a NextToken
in a response from a botocore paginator as we'll inject that in key in some situations. I think we can improve the documentation here to be a little more clear.
@joguSD Thanks for the reply. In what situation do we get a NextToken on the ListObjectsV2 paginator? (Partly curious since if that's true my code will break) From what I see the pagination config has the output_token for ListObjectsV2 defined as NextContinuationToken.
"ListObjectsV2": {
"more_results": "IsTruncated",
"limit_key": "MaxKeys",
"output_token": "NextContinuationToken",
"input_token": "ContinuationToken",
"result_key": [
"Contents",
"CommonPrefixes"
]
}
Thanks again!
@seittema It's only injected when using an undocumented pagination method build_full_results
, here. As long as you're not using that method it won't be injected and you should be fine.
@seittema Did you figure it out. I am having the same issue. In the documentation at the boto3 website the request syntax does not contain the continuation token, while the response does. I am confused, as i don't know whether to use NextContinuationToken or NextToken
@jalajkvarshney They still have not updated the documentation to correct it. You need to use NextContinuationToken for the list_objects_v2, not NextToken