镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Method .getValue() returns only 100 items from *CollectionResponse #1498

Closed as not planned

Description

Expected behavior

Method .getValue() will return all items from *CollectionResponse

Actual behavior

Method .getValue() returns always first 100 items from *CollectionResponse

Steps to reproduce the behavior

//Fetching the members of a group who are of the type User 
//graph.microsoft.com/v1.0/groups/{group-id}/members/microsoft.graph.user 
UserCollectionResponse usersInGroup = graphClient
    .groups()
    .byGroupId("group-id")
    .members()
    .graphUser()
    .get();

List<User> users = usersInGroup.getValue();
System.out.println(users.size());

While result from iterating it with Page iterator returns different size.

Lib:

<dependency>
    <groupId>com.microsoft.graph</groupId>
    <artifactId>microsoft-graph</artifactId>
    <version>6.1.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.microsoft.graph</groupId>
            <artifactId>microsoft-graph-core</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.microsoft.graph</groupId>
    <artifactId>microsoft-graph-core</artifactId>
    <version>3.1.1</version>
</dependency>

Activity

  1. baywet commented on Feb 12, 2024

    @baywet
    Member

    Hi michalchotvac (@MichalChotvac)
    This was already addressed by #1485 which was released on last Friday with version 3.1.1 (for core).
    Can you make sure your dependencies are up to date please and re-open the issue if you're still facing difficulties?
    Thanks!

  2. baywet commented on Feb 12, 2024

    @baywet
    Member

    Sorry, I just saw you had the proper dependencies versions.
    This is expected behaviour, we're still in the process of rolling out the documentation for the v6 GA, but for future reference the updated snippet will be available here
    And in the meantime you can find a snippet here

  3. MichalChotvac commented on Feb 13, 2024

    @MichalChotvac
    Author

    Hello Vincent Biret (@baywet) so it is rather better to use always Iterator then getValues() to get all values and not only first 100?

  4. baywet commented on Feb 13, 2024

    @baywet
    Member

    If your application needs more than the first 100 results, yes. That's how the SDK was designed.

  5. MichalChotvac commented on Feb 13, 2024

    @MichalChotvac
    Author

    If your application needs more than the first 100 results, yes. That's how the SDK was designed.

    Thanks for clarification Vincent Biret (@baywet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existsfixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions