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

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^pic_[0-9A-HJKMNP-TV-Z]{26}$
slugstringyes
  • pattern ^[2-9a-km-zA-HJ-NP-Z]{8}$
titlestringyes
descriptionstring
mime_typestring
extenum
  • one of "jpg", "png", "webp", "gif", "avif"
widthintegeryes
  • minimum 0
heightintegeryes
  • minimum 0
bytesinteger
  • minimum 0
animatedboolean
altstring
alt_sourcestring | null
aiobject | null
content_labelsobject
stateenum
  • one of "active", "hidden", "removed"
created_atstring
listedbooleanyes
tagsarray of stringyes
  • maxItems 10
authorstring
likesinteger
  • minimum 0
viewsinteger
  • minimum 0
published_atstring | null
report_countinteger
  • minimum 0
linksobjectyes
  • no other fields
links.pagestringyes
links.directstringyes
links.thumbstringyes
links.markdownstringyes
links.htmlstringyes
links.bbcodestringyes

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