GitCommit git.commit@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- git
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/git/commit.v1.json
One commit on OpenVibe.Git: its sha, message, author and committer, parents, tree, and — for the commit page or a contents write — its diff and per-file counts. api/view/commit.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
sha | string | yes | The commit id: 40 hex characters (SHA-1) or 64 (SHA-256). |
|
repo | string | yes |
| |
message | string | yes |
| |
subject | string | The first line of the message. |
| |
author | object | yes |
| |
author.name | string | yes | ||
author.email | string | yes | ||
author.username | string | null | The OpenVibe username when the email is a verified one. | ||
author.date | string | yes |
| |
committer | object | yes |
| |
committer.name | string | yes | ||
committer.email | string | yes | ||
committer.date | string | yes |
| |
parents | array of string | yes |
| |
tree_sha | string | yes |
| |
date | string | yes |
| |
stats | object | null | |||
files | array of object | The changed files, when the caller asked for the diff. |
| |
files[].path | string | yes | ||
files[].previous_path | string | null | |||
files[].status | enum | yes |
| |
files[].additions | integer | yes |
| |
files[].deletions | integer | yes |
| |
files[].patch | string | null | |||
diff | string | null | The unified diff, when the caller asked for it. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: with-diff
{
"sha": "4f0c2d9a1e8b7c6d5a4f3e2d1c0b9a8f7e6d5c4b",
"repo": "openvibers/openvibe.codes",
"message": "Open the desk from a phone\n\nA narrow layout and a bigger tap target.",
"subject": "Open the desk from a phone",
"author": {
"name": "Sam",
"email": "[email protected]",
"username": "sam",
"date": "2026-11-09T08:40:00Z"
},
"committer": {
"name": "Sam",
"email": "[email protected]",
"date": "2026-11-09T08:40:00Z"
},
"parents": [
"a1b2c3d4e5f60718293a4b5c6d7e8f9012345678"
],
"tree_sha": "b2c3d4e5f60718293a4b5c6d7e8f901234567890",
"date": "2026-11-09T08:40:00Z",
"stats": {
"files": 2,
"additions": 34,
"deletions": 6
},
"files": [
{
"path": "public/css/codes.css",
"previous_path": null,
"status": "modified",
"additions": 30,
"deletions": 6,
"patch": "@@ -12,3 +12,27 @@\n .desk { display: grid; }\n"
},
{
"path": "test/phone.test.js",
"previous_path": null,
"status": "added",
"additions": 4,
"deletions": 0,
"patch": null
}
],
"diff": "diff --git a/public/css/codes.css b/public/css/codes.css\n"
}Rejected: bad-sha-and-repo
{
"sha": "4f0c2d9a1e8b7c6d5a4f3e2d1c0b9a8f7e6d5c4b",
"repo": "openviber",
"message": "not a repo name",
"author": {
"name": "",
"email": "[email protected]",
"date": "yesterday"
},
"committer": {
"name": "Sam",
"email": "[email protected]",
"date": "2026-11-09T08:40:00Z"
},
"parents": [],
"tree_sha": "xyz",
"date": "2026-11-09T08:40:00Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('git.commit@1', value); // { valid, errors: [{ path, message }] }