microsoftgraph / microsoftgraph/msgraph-sdk-python
Regression: CreateLinkPostRequestBody serializes retainInheritedPermissions=false by default starting in 1.59.2
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 630
- 派生
- 96
- 平均合并
- 15 小时 20 分钟
- 30 天内合并 PR
- 3
描述
Describe the bug
Context
I was using the CreateLinkPostRequestBody to create some link to my driveItems, and it was working properly, but at some point I noticed that some of these files would not be visible to some users anymore (inherited permissions were lost).
The "bug"
Starting with msgraph-sdk-python 1.59.2, CreateLinkPostRequestBody serializes: { "retainInheritedPermissions": false, "sendNotification": false } when these properties are not explicitly set by the caller.
This changes the behavior of the createLink API. According to the Microsoft Graph documentation, retainInheritedPermissions is optional and the service default when omitted is true .
Expected behavior
I believe that the CreateLinkPostRequestBody default attribute values should follow the defaults of the createLink API.
Thus setting retainInheritedPermissions to true (or unset) for the createLink API if not provided in CreateLinkPostRequestBody.
How to reproduce
test.py
from msgraph.generated.drives.item.items.item.create_link.create_link_post_request_body import CreateLinkPostRequestBody
request_body = CreateLinkPostRequestBody(
type="view",
scope="organization"
)
from kiota_serialization_json.json_serialization_writer import JsonSerializationWriter
writer = JsonSerializationWriter()
request_body.serialize(writer)
print(writer.get_serialized_content().decode('utf-8'))
Results
version 1.58.0
{
"scope": "organization",
"type": "view"
}
This will let the createLink API default the retainInheritedPermissions to True.
version 1.59.2 and 1.60.0
{
"retainInheritedPermissions": false,
"scope": "organization",
"sendNotification": false,
"type": "view"
}
This will remove existing permissions.
SDK Version
1.59.2
Latest version known to work for scenario above?
1.58.0
Known Workarounds
Explicitly adding the retain_inherited_permissions = True
request_body = CreateLinkPostRequestBody(
retain_inherited_permissions=True,
type="view",
scope="organization"
)
Debug output
Click to expand log
```</details>
### Configuration
Ubuntu 22.04
x86_64
### Other information
_No response_
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从导入路径中显示的生成的 CreateLinkPostRequestBody 入口点开始,使用 test.py 示例重现序列化。将输出与版本 1.58.0 和 1.59.2 进行比较,重点关注被省略的 retainInheritedPermissions 和 sendNotification 值。当未设置的属性不再序列化 false 值,从而允许应用 createLink API 默认值时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 75/100