Validate Diff Commit List Resource¶
Added in 4.0
Verifies whether or not a diff file for a commit will work.
This allows clients to validate whether or not diff files for commits can be parsed and displayed without actually creating a review request first.
Details¶
| Name | commit_validation |
| URI | /api/validation/commits/ |
| Required Features |
|
| Token Policy ID | commit_validation |
| HTTP Methods | |
| Parent Resource | |
| Child Resources | None |
Fields¶
| validation_infoString | Validation metadata to pass to this resource to help validate the next commit. |
Links¶
Name |
Method |
Resource |
|---|---|---|
| create | POST |
|
| self | GET |
HTTP GET¶
Return links for using this resource.
Errors¶
| 100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
| 101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
| 103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
| 112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
| 113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
HTTP POST¶
Validate a diff for a commit.
This API has a similar signature to the Draft DiffCommit resource POST API, but instead of actually creating commits, it will return a result representing whether or not the included diff file parsed and validated correctly.
This API must be called before posting to the Draft DiffCommit
resource because the
validation_info field returned by this resource is required for
posting to that resource.
Request Parameters¶
| commit_idString | Required The ID of the commit being validated. |
| diffUploaded file | Required The diff file to validate. |
| parent_idString | Required The ID of the parent commit. |
| repositoryString | Required The path or ID of the repository. |
| base_commit_idString | The base commit ID. |
| parent_diffUploaded file | The parent diff of the commit being validated. |
| validation_infoString | Validation metadata from a previous call to this API. This field is required for all but the first commit in a series. |
Errors¶
Examples¶
application/vnd.reviewboard.org.commit-validation+json¶
$ curl https://reviews.example.com/api/validation/commits/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 208
Content-Type: application/vnd.reviewboard.org.commit-validation+json
ETag: 41d2fd88cfd2a302065e3ac545fb3e40b6a2dc16
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"links": {
"create": {
"href": "https://reviews.example.com/api/validation/commits/",
"method": "POST"
},
"self": {
"href": "https://reviews.example.com/api/validation/commits/",
"method": "GET"
}
},
"stat": "ok"
}