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

FieldTypeRequiredDescriptionConstraints
servicestringyes
  • pattern ^[a-z][a-z0-9-]{1,39}$
typestringyes
  • pattern ^[a-z][a-z0-9_]{1,39}$
idstringyes
  • minLength 1
  • maxLength 128
revisioninteger
  • minimum 0
labelstringCached display label. Never authoritative.
  • maxLength 200

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 }] }