PicsPicture pics.picture@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- media-hub
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/pics/picture.v1.json
A Pics picture. Public counts and attribution are returned for opted-in public gallery entries only. Uploads are private by default.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
slug | string | yes |
| |
title | string | yes | ||
description | string | |||
mime_type | string | |||
ext | enum |
| ||
width | integer | yes |
| |
height | integer | yes |
| |
bytes | integer |
| ||
animated | boolean | |||
alt | string | |||
alt_source | string | null | |||
ai | object | null | |||
content_labels | object | |||
state | enum |
| ||
created_at | string | |||
listed | boolean | yes | ||
tags | array of string | yes |
| |
author | string | |||
likes | integer |
| ||
views | integer |
| ||
published_at | string | null | |||
report_count | integer |
| ||
links | object | yes |
| |
links.page | string | yes | ||
links.direct | string | yes | ||
links.thumb | string | yes | ||
links.markdown | string | yes | ||
links.html | string | yes | ||
links.bbcode | string | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: basic
{
"id": "pic_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"slug": "Abcdef23",
"title": "Forest",
"width": 800,
"height": 600,
"listed": true,
"tags": [
"forest"
],
"links": {
"page": "https://openvibe.pics/i/Abcdef23",
"direct": "https://openvibe.pics/i/Abcdef23",
"thumb": "https://openvibe.pics/i/Abcdef23",
"markdown": "https://openvibe.pics/i/Abcdef23",
"html": "https://openvibe.pics/i/Abcdef23",
"bbcode": "https://openvibe.pics/i/Abcdef23"
}
}Rejected: missing
{}Validate
const contracts = require('openvibe-contracts');
contracts.validate('pics.picture@1', value); // { valid, errors: [{ path, message }] }