Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API /api/asset/upload response body succMap field #12361

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

Zuoqiu-Yingyi
Copy link
Contributor

稳定 API /api/asset/upload#12255 中引入了破坏性变更
Stable API /api/asset/upload introduced a breaking change in #12255

响应体中 succMap 对象的字段名在部分情况下均会被错误得替换为实际保存的文件名, 导致 API 的调用者无法获取原文件名到新文件名的映射
In some cases, the field name and field value of the succMap object in the response body will be incorrectly replaced with the actual saved file name, causing the caller of the API to be unable to get the mapping from the original file name to the new file name.

同时造成该 API 的行为与文档不一致
It also causes the API to behave inconsistently with the documentation.

{
  "code": 0,
  "msg": "",
  "data": {
    "errFiles": [""],
    "succMap": {
-      "foo.png": "assets/foo-20210719092549-9j5y79r.png"
+      "foo-20210719092549-9j5y79r.png": "assets/foo-20210719092549-9j5y79r.png"
    }
  }
}

已经过测试
TESTED

@88250 88250 added the Bug label Aug 30, 2024
@88250 88250 added this to the 3.1.5 milestone Aug 30, 2024
@88250 88250 added Development and removed Bug labels Aug 30, 2024
@88250 88250 merged commit b924452 into siyuan-note:dev Aug 30, 2024
@88250
Copy link
Member

88250 commented Aug 30, 2024

感谢你的贡献,思源有你更精彩!
Thank you for your contribution. SiYuan will be more wonderful with you!

@88250 88250 mentioned this pull request Aug 30, 2024
2 tasks
@Zuoqiu-Yingyi Zuoqiu-Yingyi deleted the fix/api-upload-succMap branch August 30, 2024 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants