diff options
Diffstat (limited to 'doc/api/discussions.md')
-rw-r--r-- | doc/api/discussions.md | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/doc/api/discussions.md b/doc/api/discussions.md index 8640f3b45c6..b12131e4746 100644 --- a/doc/api/discussions.md +++ b/doc/api/discussions.md @@ -712,7 +712,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/discussions "updated_at": "2018-03-03T21:54:39.668Z", "system": false, "noteable_id": 3, - "noteable_type": "Merge request", + "noteable_type": "MergeRequest", "project_id": 5, "noteable_iid": null, "resolved": false, @@ -737,7 +737,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/discussions "updated_at": "2018-03-04T13:38:02.127Z", "system": false, "noteable_id": 3, - "noteable_type": "Merge request", + "noteable_type": "MergeRequest", "project_id": 5, "noteable_iid": null, "resolved": false, @@ -767,7 +767,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/discussions "updated_at": "2018-03-04T09:17:22.520Z", "system": false, "noteable_id": 3, - "noteable_type": "Merge request", + "noteable_type": "MergeRequest", "project_id": 5, "noteable_iid": null, "resolved": false, @@ -804,7 +804,7 @@ Diff comments also contain position: "updated_at": "2018-03-04T09:17:22.520Z", "system": false, "noteable_id": 3, - "noteable_type": "Merge request", + "noteable_type": "MergeRequest", "project_id": 5, "noteable_iid": null, "commit_id": "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031", @@ -865,8 +865,6 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" \ ### Create new merge request thread -> The `commit id` entry was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47130) in GitLab 13.7. - Creates a new thread to a single project merge request. Similar to creating a note but other comments (replies) can be added to it later. For other approaches, see [Post comment to commit](commits.md#post-comment-to-commit) in the Commits API, @@ -878,27 +876,27 @@ POST /projects/:id/merge_requests/:merge_request_iid/discussions Parameters for all comments: -| Attribute | Type | Required | Description | -| ---------------------------------------- | -------------- | -------- | ----------- | -| `body` | string | yes | The content of the thread. | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). | -| `merge_request_iid` | integer | yes | The IID of a merge request. | -| `position[base_sha]` | string | yes | Base commit SHA in the source branch. | -| `position[head_sha]` | string | yes | SHA referencing HEAD of this merge request. | -| `position[start_sha]` | string | yes | SHA referencing commit in target branch. | +| Attribute | Type | Required | Description | +| ---------------------------------------- | -------------- |--------------------------------------| ----------- | +| `body` | string | yes | The content of the thread. | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). | +| `merge_request_iid` | integer | yes | The IID of a merge request. | +| `position[base_sha]` | string | yes (if `position*` is supplied) | Base commit SHA in the source branch. | +| `position[head_sha]` | string | yes (if `position*` is supplied) | SHA referencing HEAD of this merge request. | +| `position[start_sha]` | string | yes (if `position*` is supplied) | SHA referencing commit in target branch. | | `position[new_path]` | string | yes (if the position type is `text`) | File path after change. | | `position[old_path]` | string | yes (if the position type is `text`) | File path before change. | -| `position[position_type]` | string | yes | Type of the position reference. Allowed values: `text` or `image`. | -| `commit_id` | string | no | SHA referencing commit to start this thread on. | -| `created_at` | string | no | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights. | -| `position` | hash | no | Position when creating a diff note. | -| `position[new_line]` | integer | no | For `text` diff notes, the line number after change. | -| `position[old_line]` | integer | no | For `text` diff notes, the line number before change. | -| `position[line_range]` | hash | no | Line range for a multi-line diff note. | -| `position[width]` | integer | no | For `image` diff notes, width of the image. | -| `position[height]` | integer | no | For `image` diff notes, height of the image. | -| `position[x]` | float | no | For `image` diff notes, X coordinate. | -| `position[y]` | float | no | For `image` diff notes, Y coordinate. | +| `position[position_type]` | string | yes (if position* is supplied) | Type of the position reference. Allowed values: `text` or `image`. | +| `commit_id` | string | no | SHA referencing commit to start this thread on. | +| `created_at` | string | no | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights. | +| `position` | hash | no | Position when creating a diff note. | +| `position[new_line]` | integer | no | For `text` diff notes, the line number after change. | +| `position[old_line]` | integer | no | For `text` diff notes, the line number before change. | +| `position[line_range]` | hash | no | Line range for a multi-line diff note. | +| `position[width]` | integer | no | For `image` diff notes, width of the image. | +| `position[height]` | integer | no | For `image` diff notes, height of the image. | +| `position[x]` | float | no | For `image` diff notes, X coordinate. | +| `position[y]` | float | no | For `image` diff notes, Y coordinate. | #### Create a new thread on the overview page @@ -1289,17 +1287,17 @@ POST /projects/:id/repository/commits/:commit_id/discussions Parameters: -| Attribute | Type | Required | Description | -| ------------------------- | -------------- | -------- | ----------- | -| `body` | string | yes | The content of the thread. | -| `commit_id` | string | yes | The SHA of a commit. | -| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). | -| `position[base_sha]` | string | yes | SHA of the parent commit. | -| `position[head_sha]` | string | yes | The SHA of this commit. Same as `commit_id`. | -| `position[start_sha]` | string | yes | SHA of the parent commit. | -| `position[position_type]` | string | yes | Type of the position reference. Allowed values: `text` or `image`. | -| `created_at` | string | no | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights. | -| `position` | hash | no | Position when creating a diff note. | +| Attribute | Type | Required | Description | +| ------------------------- | -------------- |----------------------------------| ----------- | +| `body` | string | yes | The content of the thread. | +| `commit_id` | string | yes | The SHA of a commit. | +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). | +| `position[base_sha]` | string | yes (if `position*` is supplied) | SHA of the parent commit. | +| `position[head_sha]` | string | yes (if `position*` is supplied) | The SHA of this commit. Same as `commit_id`. | +| `position[start_sha]` | string | yes (if `position*` is supplied) | SHA of the parent commit. | +| `position[position_type]` | string | yes (if `position*` is supplied) | Type of the position reference. Allowed values: `text` or `image`. | +| `created_at` | string | no | Date time string, ISO 8601 formatted, such as `2016-03-11T03:45:40Z`. Requires administrator or project/group owner rights. | +| `position` | hash | no | Position when creating a diff note. | | `position[new_path]` | string | no | File path after change. | | `position[new_line]` | integer | no | Line number after change. | |