[2.0.0-RC13] TransitiveMemberOfRequestBuilder ignoring QueryParameters select

Abierto
#1,228 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
php
Área
api

Línea de trabajo

Comienza en TransitiveMemberOfRequestBuilder->get() y en el manejo de queryParameters->select; después, sigue cómo la respuesta rellena DirectoryObjectCollectionResponse y los modelos Group. Compara los campos solicitados en la URL generada con los campos disponibles después de wait(); la tarea está terminada cuando las propiedades seleccionadas se devuelven de forma coherente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

ToTriage

Upon creating a TransitiveMemberOfRequestBuilder and applying a TransitiveMemberOfRequestBuilderGetRequestConfiguration->queryParameters->select I can see the URL is changed to include the $select fields in odataNextLink. But when I actualy run the query with get($groupsRequestConfig) the additional fields are not returned.

If I take the URL and put it into graph explorer, it returns the fields as requested.

Sample code and var_dump's

<?php

$groupsRequest = $GraphServiceClient->me()->transitiveMemberOf();

$groupsRequestConfig = new TransitiveMemberOfRequestBuilderGetRequestConfiguration();
$groupsRequestConfig->queryParameters = new TransitiveMemberOfRequestBuilderGetQueryParameters();
$groupsRequestConfig->queryParameters->select = [
    'id',
    'samAccountName',
    'displayName',
    'groupTypes',
    'securityEnabled'
];

$groupsResponse = $groupsRequest->get($groupsRequestConfig);    # Http\Promise\FulfilledPromise
$groups = $groupsResponse->wait();  # Microsoft\Graph\Generated\Models\DirectoryObjectCollectionResponse

$myGroups = []
foreach ($groups->getValue() as $g) {
    $myGroups[] = $g->getDisplayName();
}

/*
$groups = object(Microsoft\Graph\Generated\Models\DirectoryObjectCollectionResponse)#302 (1) {
  ["backingStore":"Microsoft\Graph\Generated\Models\BaseCollectionPaginationCountResponse":private]=>
  object(Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore)#298 (4) {
    ["isInitializationCompleted":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
    bool(true)
    ["returnOnlyChangedValues":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
    bool(false)
    ["store":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
    array(3) {
      ["additionalData"]=>
      array(3) {
        [0]=>
        bool(false)
        [1]=>
        array(1) {
          ["@odata.context"]=>
          string(117) "https://graph.microsoft.com/v1.0/$metadata#directoryObjects(id,samAccountName,displayName,groupTypes,securityEnabled)"
        }
        [2]=>
        int(1)
      }
      ["odataNextLink"]=>
      array(2) {
        [0]=>
        bool(false)
        [1]=>
        string(303) "https://graph.microsoft.com/v1.0/me/transitiveMemberOf?$select=id%2csamAccountName%2cdisplayName%2cgroupTypes%2csecurityEnabled&$skiptoken=R..."
      }
      ["value"]=>
      array(3) {
        [0]=>
        bool(false)
        [1]=>
        array(100) {
          [0]=>
          object(Microsoft\Graph\Generated\Models\Group)#194 (1) {
            ["backingStore":"Microsoft\Graph\Generated\Models\Entity":private]=>
            object(Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore)#193 (4) {
              ["isInitializationCompleted":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
              bool(true)
              ["returnOnlyChangedValues":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
              bool(false)
              ["store":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
              array(6) {
                ["additionalData"]=>
                array(3) {
                  [0]=>
                  bool(true)
                  [1]=>
                  array(0) {
                  }
                  [2]=>
                  int(0)
                }
                ["odataType"]=>
                array(2) {
                  [0]=>
                  bool(true)
                  [1]=>
                  string(22) "#microsoft.graph.group"
                }
                ["id"]=>
                array(2) {
                  [0]=>
                  bool(true)
                  [1]=>
                  string(36) "b...4"
                }
                ["displayName"]=>
                array(2) {
                  [0]=>
                  bool(true)
                  [1]=>
                  NULL
                }
...

$g = object(Microsoft\Graph\Generated\Models\Group)#556 (1) {
  ["backingStore":"Microsoft\Graph\Generated\Models\Entity":private]=>
  object(Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore)#555 (4) {
    ["isInitializationCompleted":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
    bool(true)
    ["returnOnlyChangedValues":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
    bool(false)
    ["store":"Microsoft\Kiota\Abstractions\Store\InMemoryBackingStore":private]=>
    array(6) {
      ["additionalData"]=>
      array(3) {
        [0]=>
        bool(true)
        [1]=>
        array(0) {
        }
        [2]=>
        int(0)
      }
      ["odataType"]=>
      array(2) {
        [0]=>
        bool(true)
        [1]=>
        string(22) "#microsoft.graph.group"
      }
      ["id"]=>
      array(2) {
        [0]=>
        bool(true)
        [1]=>
        string(36) "8...8"
      }
      ["displayName"]=>
      array(2) {
        [0]=>
        bool(true)
        [1]=>
        NULL
      }
....
*/
?>

PS. Please create more documentation, this sdk is a monster for having so little documentation and examples.

Lenguaje dominante
PHP
Estrellas
669
Forks
150
Merge medio
15 h 21 min
PR fusionados (30 d)
3

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoftgraph/msgraph-sdk-php

Todos los issues de microsoftgraph/msgraph-sdk-php

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.