microsoftgraph / microsoftgraph/msgraph-sdk-python

Inconsistent usage of 'select' OData system query option

Aberta
#661 4 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

bug dependency:metadata
Linguagem predominante
Python
Estrelas
630
Forks
96
Merge médio
15h 20min
PRs com merge (30d)
3

Descrição

Describe the bug

When I query the SharePoint API using 'expand' and 'select' query options, the API expects 'select' and not '$select'.

This is not a huge problem as I can easily change my query params to use 'select', however we cannot use the Python msgraph SDK as it always converts the special system query options with a $ prepended.

To Reproduce
Steps to reproduce the behavior:

  1. Using the Developer Graph Explorer run a query similar to this:

/items$expand=fields&$select=fields/status,lastModifiedDateTime,id

  1. See error:
    { "error": { "code": "BadRequest", "message": "Parsing OData Select and Expand failed: Found a path with multiple navigation properties or a bad complex property path in a select clause. Please reword your query such that each level of select or expand only contains either TypeSegments or Properties.", "innerError": { "date": "2024-04-09T18:29:12", "request-id": "60cb4f4b-e5f4-48ee-8f1c-981e88440310", "client-request-id": "ed396593-a29f-0d6b-d2d7-d8dc632e4edc" } } }

Workaround
4.Change the '$select' query param to 'select' (without the dollar sign) and you get a valid response.

/items$expand=fields&select=fields/status,lastModifiedDateTime,id

Expected behavior
A valid listitems response from the API using $select

Additional context
This also happens on the items/{id}/versions endpoint

Documentation for OData query options indicates $select as the query param:

https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Reproduza a solicitação no Developer Graph Explorer e por meio do SDK Python msgraph, concentrando-se nos endpoints items e items/{id}/versions. Rastreie como o SDK serializa as opções de consulta do sistema OData e compare as solicitações que usam '$select' com o comportamento documentado. Está concluído quando respostas válidas de list-items e versions funcionarem com '$select' junto de '$expand'.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
api
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.