microsoftgraph / microsoftgraph/msgraph-sdk-python

Inconsistent usage of 'select' OData system query option

Aperta
#661 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug dependency:metadata
Lingua principale
Python
Stelle
630
Fork
96
Merge medio
15h 20m
PR unite (30g)
3

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riprodurre la richiesta in Developer Graph Explorer e tramite l'SDK Python msgraph, concentrandosi sugli endpoint items e items/{id}/versions. Tracciare il modo in cui l'SDK serializza le opzioni di query di sistema OData e confrontare le richieste che usano '$select' con il comportamento documentato. Il lavoro è completato quando risposte valide di list-items e versions funzionano insieme a '$select' e '$expand'.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.