Skip to content
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

Misleading docs: CognitoIdentityProvider.Client.list_users() #1356

Closed
jonasao opened this issue Nov 17, 2017 · 5 comments
Closed

Misleading docs: CognitoIdentityProvider.Client.list_users() #1356

jonasao opened this issue Nov 17, 2017 · 5 comments
Assignees
Labels
cognito-idp documentation This is a problem with documentation. p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.

Comments

@jonasao
Copy link

jonasao commented Nov 17, 2017

The docs for CognitoIdentityProvider.Client.list_users() shows the following example on how to call this method:

response = client.list_users(
    UserPoolId='string',
    AttributesToGet=[
        'string',
    ],
    Limit=123,
    PaginationToken='string',
    Filter='string'
)

Misleading 1 - Limit must be less than 60

When attempting to call this method with Limit=123 the following exception is thrown:

botocore.errorfactory.InvalidParameterException: 
An error occurred (InvalidParameterException) when calling the ListUsers operation:
1 validation error detected: Value '100' at 'limit' failed to satisfy constraint: 
Member must have value less than or equal to 60

In my opinion, if the max. number of records is 60, the example should display Limit=60, or at least this limitation should be mentioned in the docs.

Misleading 2 - AttributesToGet

The documentation clearly states the following:
"An array of strings, where each string is the name of a user attribute to be returned for each user in the search results. If the array is empty, all attributes are returned."

If one were to return attributes for all users (max=60 pr. page), this will lead to the following config (based on the documentation above):

response = client.list_users(
    UserPoolId='string',
    AttributesToGet=[ ],
    Limit=60,
    PaginationToken='string',
    Filter='string'
)

WRONG!

In order to make this method return all attributes for all users, the AttributesToGet parameter must be excluded, such in this example:

response = client.list_users(
    UserPoolId='string',
    Limit=60,
    PaginationToken='string',
    Filter='string'
)

Please correct the docs, replacing the phrase "If the array is empty, all attributes are returned." with the phrase "If this parameter is excluded, all attributes are returned.".

See the full docs here:
CognitoIdentityProvider.Client.list_users()

@kyleknap
Copy link
Member

Thanks for the feedback. We generate our documentation from upstream sources so we will pass on the feedback upstream in order for our documentation for those two parameters to get updated as well. We will also look into seeing if we can get an example added as well so there is sample code other than the request syntax snippet, which is not guaranteed to work if you use it exactly as is.

@kyleknap kyleknap added the documentation This is a problem with documentation. label Nov 20, 2017
@thelpbogeyman
Copy link

This is still an issue - as of latest version of docs (v2.1.1) and code (boto3==1.16.18).

@doug65536
Copy link

doug65536 commented Nov 2, 2021

Omitting the AttributesToGet parameter does not make it list all attributes. The documentation says that you get all attributes if you specify null. There is no null in Python, passing None causes an invalid parameter exception.

@kdaily kdaily added service-api This issue is caused by the service API, not the SDK implementation. needs-review labels Dec 11, 2021
@aBurmeseDev aBurmeseDev added the p2 This is a standard priority issue label Nov 8, 2022
@tim-finnigan tim-finnigan self-assigned this Apr 17, 2024
@tim-finnigan
Copy link
Contributor

tim-finnigan commented Apr 17, 2024

Thanks all for your patience. The recently came up in another issue (#4079). After discussion with the team, we decided to create a new tracking issue (#4088) that consolidates these two and provides some more context on the team's thoughts. Please feel free to 👍 and comment on that issue going forward.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cognito-idp documentation This is a problem with documentation. p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

7 participants