Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move Repo Comments API to its own page.

  • Loading branch information...
commit 2a4583d83ba79d27f6fee329e352739c826cd5c2 1 parent d6599c8
@bgrainger bgrainger authored
View
111 content/v3/repos/comments.md
@@ -0,0 +1,111 @@
+---
+title: Repo Comments | GitHub API
+---
+
+# Repo Comments API
+
+## List commit comments for a repository
+
+Commit Comments leverage [these](#custom-mime-types) custom mime types. You can
+read more about the use of mime types in the API [here](/v3/mime/).
+
+Comments are ordered by ascending ID.
+
+ GET /repos/:user/:repo/comments
+
+### Response
+
+<%= headers 200 %>
+<%= json(:commit_comment) { |h| [h] } %>
+
+## List comments for a single commit
+
+ GET /repos/:user/:repo/commits/:sha/comments
+
+### Response
+
+<%= headers 200 %>
+<%= json(:commit_comment) %>
+
+## Create a commit comment
+
+ POST /repos/:user/:repo/commits/:sha/comments
+
+### Input
+
+body
+: _Required_ **string**
+
+commit_id
@catsby
catsby added a note

Isn't this redundant? The :sha is in the URL and the POST body

@pengwynn Owner

Probably. Patches welcome :-)

@catsby
catsby added a note

I can't patch the API :(

I send a patch to the docs if it turns out that commit_id isn't actually need though. Should be able to check in a bit.

@pengwynn Owner

Yeah, commit_id isn't needed from the outside from what I can tell. It's found via the sha.

@catsby
catsby added a note

Ah, then I'll send a patch soon, unless you're going to beat me to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+: _Required_ **string** - Sha of the commit to comment on.
+
+line
+: _Required_ **number** - Line number in the file to comment on.
+
+path
+: _Required_ **string** - Relative path of the file to comment on.
+
+position
+: _Required_ **number** - Line index in the diff to comment on.
+
+#### Example
+
+<%= json \
+ :body => 'Nice change',
+ :commit_id => '6dcb09b5b57875f334f61aebed695e2e4193db5e',
+ :line => 1,
+ :path => 'file1.txt',
+ :position => 4
+%>
+
+### Response
+
+<%= headers 201, :Location => "https://api.github.com/user/repo/comments/1" %>
+<%= json :commit_comment %>
+
+## Get a single commit comment
+
+ GET /repos/:user/:repo/comments/:id
+
+### Response
+
+<%= headers 200 %>
+<%= json :commit_comment %>
+
+## Update a commit comment
+
+ PATCH /repos/:user/:repo/comments/:id
+
+### Input
+
+body
+: _Required_ **string**
+
+#### Example
+
+<%= json \
+ :body => 'Nice change'
+%>
+
+### Response
+
+<%= headers 200 %>
+<%= json :commit_comment %>
+
+## Delete a commit comment
+
+ DELETE /repos/:user/:repo/comments/:id
+
+### Response
+
+<%= headers 204 %>
+
+## Custom Mime Types
+
+These are the supported mime types for commit comments. You can read more
+about the use of mime types in the API [here](/v3/mime/).
+
+ application/vnd.github-commitcomment.raw+json
+ application/vnd.github-commitcomment.text+json
+ application/vnd.github-commitcomment.html+json
+ application/vnd.github-commitcomment.full+json
View
106 content/v3/repos/commits.md
@@ -33,94 +33,6 @@ will be returned.
Note: Diffs with binary data will have no 'patch' property.
-## List commit comments for a repository
-
-Commit Comments leverage [these](#custom-mime-types) custom mime types. You can
-read more about the use of mime types in the API [here](/v3/mime/).
-
-Comments are ordered by ascending ID.
-
- GET /repos/:user/:repo/comments
-
-### Response
-
-<%= headers 200 %>
-<%= json(:commit_comment) { |h| [h] } %>
-
-## List comments for a single commit
-
- GET /repos/:user/:repo/commits/:sha/comments
-
-### Response
-
-<%= headers 200 %>
-<%= json(:commit_comment) %>
-
-## Create a commit comment
-
- POST /repos/:user/:repo/commits/:sha/comments
-
-### Input
-
-body
-: _Required_ **string**
-
-commit_id
-: _Required_ **string** - Sha of the commit to comment on.
-
-line
-: _Required_ **number** - Line number in the file to comment on.
-
-path
-: _Required_ **string** - Relative path of the file to comment on.
-
-position
-: _Required_ **number** - Line index in the diff to comment on.
-
-#### Example
-
-<%= json \
- :body => 'Nice change',
- :commit_id => '6dcb09b5b57875f334f61aebed695e2e4193db5e',
- :line => 1,
- :path => 'file1.txt',
- :position => 4
-%>
-
-### Response
-
-<%= headers 201, :Location => "https://api.github.com/user/repo/comments/1" %>
-<%= json :commit_comment %>
-
-## Get a single commit comment
-
- GET /repos/:user/:repo/comments/:id
-
-### Response
-
-<%= headers 200 %>
-<%= json :commit_comment %>
-
-## Update a commit comment
-
- PATCH /repos/:user/:repo/comments/:id
-
-### Input
-
-body
-: _Required_ **string**
-
-#### Example
-
-<%= json \
- :body => 'Nice change'
-%>
-
-### Response
-
-<%= headers 200 %>
-<%= json :commit_comment %>
-
## Compare two commits
GET /repos/:user/:repo/compare/:base...:head
@@ -128,21 +40,3 @@ body
### Response
<%= json :commit_comparison %>
-
-## Delete a commit comment
-
- DELETE /repos/:user/:repo/comments/:id
-
-### Response
-
-<%= headers 204 %>
-
-## Custom Mime Types
-
-These are the supported mime types for commit comments. You can read more
-about the use of mime types in the API [here](/v3/mime/).
-
- application/vnd.github-commitcomment.raw+json
- application/vnd.github-commitcomment.text+json
- application/vnd.github-commitcomment.html+json
- application/vnd.github-commitcomment.full+json
View
1  layouts/default.html
@@ -89,6 +89,7 @@
<h3><a href="#" class="js-expand-btn collapsed">&nbsp;</a><a href="/v3/repos/">Repos</a></h3>
<ul class="js-guides">
<li><a href="/v3/repos/collaborators/">Collaborators</a></li>
+ <li><a href="/v3/repos/comments/">Comments</a></li>
<li><a href="/v3/repos/commits/">Commits</a></li>
<li><a href="/v3/repos/downloads/">Downloads</a></li>
<li><a href="/v3/repos/forks/">Forks</a></li>
Please sign in to comment.
Something went wrong with that request. Please try again.