MediaRef media.media-ref@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- media
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- ADR-006
- Schema
https://openvibe.network/contracts/media/media-ref.v1.json
Reference to a Media object. Canonical ids (med_<ULID>) arrive with the Wave 4 object model; until then legacy:<app>:<kind>:<id> addresses today's VOD/clip/file/paste/thumbnail rows.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
media_id | string | yes |
| |
role | string |
| ||
variant | string |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: canonical
{
"media_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"role": "attachment"
}Valid: legacy
{
"media_id": "legacy:live:vod:1203",
"variant": "720p"
}Rejected: bare-integer
{
"media_id": "1203"
}Rejected: unknown-kind
{
"media_id": "legacy:live:song:1"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('media.media-ref@1', value); // { valid, errors: [{ path, message }] }