GitTree git.tree@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/tree.v1.json
One directory of a repository at a ref: its entries with mode, size and the last commit that touched each. api/view/tree.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
repo | string | yes |
| |
ref | string | yes | The branch, tag or commit the tree was read at. |
|
path | string | yes | The directory, empty at the repository root. |
|
entries | array of object | yes |
| |
entries[].name | string | yes | ||
entries[].path | string | yes | ||
entries[].type | enum | yes |
| |
entries[].mode | string | yes |
| |
entries[].sha | string | yes |
| |
entries[].size | integer | null |
| ||
entries[].last_commit | object | null |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: root
{
"repo": "openvibers/openvibe.codes",
"ref": "main",
"path": "",
"entries": [
{
"name": "server",
"path": "server",
"type": "tree",
"mode": "040000",
"sha": "c3d4e5f60718293a4b5c6d7e8f90123456789012",
"size": null,
"last_commit": {
"sha": "4f0c2d9a1e8b7c6d5a4f3e2d1c0b9a8f7e6d5c4b",
"message": "Open the desk from a phone",
"date": "2026-11-09T08:40:00Z",
"author_name": "Sam"
}
},
{
"name": "README.md",
"path": "README.md",
"type": "blob",
"mode": "100644",
"sha": "d4e5f60718293a4b5c6d7e8f9012345678901234",
"size": 1421,
"last_commit": null
}
]
}Rejected: bad-type-and-size
{
"repo": "openvibers/openvibe.codes",
"ref": "main",
"path": "",
"entries": [
{
"name": "server",
"path": "server",
"type": "directory",
"mode": "040000",
"sha": "c3d4e5f60718293a4b5c6d7e8f90123456789012",
"size": -2,
"last_commit": null
}
]
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('git.tree@1', value); // { valid, errors: [{ path, message }] }