EntityRef common.entity-ref@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- contracts
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/common/entity-ref.v1.json
Typed reference to another service's entity. Store this instead of a foreign key; resolve a display projection from the owner.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
service | string | yes |
| |
type | string | yes |
| |
id | string | yes |
| |
revision | integer |
| ||
label | string | Cached display label. Never authoritative. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: vod-thread
{
"service": "media",
"type": "vod",
"id": "1203",
"revision": 3,
"label": "Friday stream"
}Rejected: no-id
{
"service": "media",
"type": "vod"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('common.entity-ref@1', value); // { valid, errors: [{ path, message }] }