How should enum arrays and flags expand in URL templates?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 31
- 派生
- 48
- 平均合并
- 16 小时 36 分钟
- 30 天内合并 PR
- 73
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/kiota-python 的其他 Issue
-
Backing store enumeration returns internal tracking tuples instead of stored lists可能已有人在做 @pradeep-ramola 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
microsoft/kiota-python#938 ·
维护者通常 1 天内回复
-
JSON numeric getters accept booleans as integers and floats可能已有人在做 @pradeep-ramola 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/kiota-python#935 ·
维护者通常 1 天内回复
-
ensure 304 response code does not throw可能重新可做 @nightcityblade 于 92 天前认领,目前没有进行中的 PR。 未关闭help wanted type:bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/kiota-python#477 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
microsoft/kiota-python#901 ·
维护者通常 1 天内回复
-
type:breaking-change
难度 5/5 一周以上 新手友好度 12/100
microsoft/kiota-python#777 · 2 条评论 ·
维护者通常 1 天内回复
查看 microsoft/kiota-python 的全部 Issue
相似的 Issue
-
backend: claude chore dependencies
难度 2/5 1-3 小时 新手友好度 72/100
briandconnelly/amicus#606 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
semantica-agi/semantica#2320 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
vllm-project/vllm-omni#11465 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
jxxghp/MoviePilot#7699 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
vllm-project/vllm-ascend#24010 ·
维护者通常 1 天内回复