How should enum arrays and flags expand in URL templates?
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 18/100
Rechercherichtung
The behaviour lives in RequestInformation query and path expansion in kiota_abstractions/request_information.py, with the enum handling introduced in #223 and kept in #883. Reproduce the four printed URLs from the issue before touching anything. Done would mean the maintainers have stated whether an enum list is an array or a flags value, and any change keeps the non-exploded %2C separator for flags.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I'd like to clarify the enum-collection contract before proposing a change to request URL construction.
On current main 17b952f81ea2a4d46bb44b6fe6b253578a0cf481, these public calls produce different URLs:
from enum import Enum
from kiota_abstractions.method import Method
from kiota_abstractions.request_information import RequestInformation
class Colour(Enum):
RED = "red"
BLUE = "blue"
for values in (["red", "blue"], [Colour.RED, Colour.BLUE]):
request = RequestInformation(Method.GET, "https://example.com/items{?colour*}")
request.query_parameters["colour"] = values
print(request.url)
https://example.com/items?colour=red&colour=blue
https://example.com/items?colour=red%2Cblue
Likewise, {/colour*} produces separate segments for the string list but one comma-joined segment for the enum list. I ran these locally on Windows/CPython 3.13.7; no service call is involved.
For a true array, repeated keys/segments match RFC6570. However, enum joining was introduced in #223 and deliberately preserved in #883, and enum lists can be used as a scalar representation in the form writer. I don't want to remove a flags convention while fixing array expansion.
Could you confirm whether generated query/path enum lists always represent array parameters, or whether they can also represent a single flags enum? If both forms exist, what should distinguish them at URI-template expansion time?
A local proposal that retains the collection makes the array examples work, but also changes non-exploded list separators from %2C to literal commas and normalizes boolean-valued enum elements differently. I'm keeping that runtime change unpublished until the intended contract is clear.
- Vorherrschende Sprache
- Python
- Sterne
- 31
- Forks
- 48
- Ø Merge
- 16 Std. 36 Min.
- Gemergte PRs (30 T.)
- 73
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/kiota-python
-
Backing store enumeration returns internal tracking tuples instead of stored listsEvtl. vergeben @pradeep-ramola hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
microsoft/kiota-python#938 ·
Maintainer antworten meist innerhalb von 1 Tag
-
JSON numeric getters accept booleans as integers and floatsEvtl. vergeben @pradeep-ramola hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/kiota-python#935 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ensure 304 response code does not throwEvtl. wieder frei @nightcityblade hat das vor 92 Tagen übernommen, und es ist kein Pull Request offen. Offenhelp wanted type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoft/kiota-python#477 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
microsoft/kiota-python#901 ·
Maintainer antworten meist innerhalb von 1 Tag
-
type:breaking-change
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 12/100
microsoft/kiota-python#777 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in microsoft/kiota-python
Ähnliche Issues
-
backend: claude chore dependencies
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
briandconnelly/amicus#606 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
semantica-agi/semantica#2320 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
vllm-project/vllm-omni#11465 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
jxxghp/MoviePilot#7699 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
vllm-project/vllm-ascend#24010 ·
Maintainer antworten meist innerhalb von 1 Tag