PlayTitleDefinition play.title-definition@1
Generated at from
openvibe-contracts v0.177.0 and
openvibe-sdk v0.44.0.
- Version
- 1.0.0
- Owner
- play
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- Games ADR-0007
- Schema
https://openvibe.network/contracts/play/title-definition.v1.json
A title as its own principal registers it (play.title.manage, PUT /api/v1/titles/:title). Achievements and boards are listed in display order; one left out is retired, never deleted. A board's kind never changes.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
name | string | yes |
| |
url | string | null | where the game is played |
| |
summary | string |
| ||
achievements | array of object |
| ||
achievements[].id | string | yes |
| |
achievements[].name | string | yes |
| |
achievements[].description | string |
| ||
achievements[].hidden | boolean | a secret achievement: its name and text show only to whoever unlocked it | ||
boards | array of object |
| ||
boards[].id | string | yes |
| |
boards[].name | string | yes |
| |
boards[].kind | enum | yes | best: each player's best score; sum: the total of their scores |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: basic
{
"name": "Salvage Rush",
"url": "https://openvibe.games/play?game=salvage-rush",
"achievements": [
{
"id": "first-haul",
"name": "First Haul",
"description": "Finish a round with scrap."
}
],
"boards": [
{
"id": "best",
"name": "Best round",
"kind": "best"
}
]
}Rejected: basic
{
"name": "X",
"boards": [
{
"id": "best",
"name": "Best",
"kind": "median"
}
]
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('play.title-definition@1', value); // { valid, errors: [{ path, message }] }