我正在尝试使用此端点使用 GitLab api 在文件的特定行上创建关于合并请求的讨论说明:https : //docs.gitlab.com/ee/api/discussions.html#create-new-合并请求线程
部分有效载荷要求 line_code
| 属性 | 类型 | 必需的 | 描述 |
|---|---|---|---|
| 位置[line_range][开始][line_code] | 细绳 | 是的 | 起始行的行代码 |
当我发出 POST 时,我收到以下回复:
"message": "400 (Bad request) \"Note {:line_code=>[\"can't be blank\", \"must be a valid line code\"], :position=>[\"is incomplete\"]}\" not given"
Run Code Online (Sandbox Code Playgroud)
这是什么line_code?它是某种计算值吗?这里的文档相当模糊。
当我为 merge_request 上的所有当前注释发出 GET 时,我可以看到一些注释有这个line_code(见下文)。我试图弄清楚如何为新笔记创造价值。
{
"id": 89,
"type": "DiffNote",
"body": "4",
"attachment": null,
"author": {
"id": 6,
"name": "brian c",
"username": "bc",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/f590a9cf57136732dd0cb5z9b1563390?s=80&d=identicon",
"web_url": "http://gitlab.mycompany.us/thisIsMe"
},
"created_at": "2021-01-11T21:46:23.861Z",
"updated_at": "2021-01-11T21:46:23.861Z",
"system": false,
"noteable_id": …Run Code Online (Sandbox Code Playgroud)