CommunityPasteWriteRequest community.paste-write-request@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
community
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/community/paste-write-request.v1.json

community.paste-write-request@1: bodies of the paste writes done as the acting person (community.paste.write) on OpenVibe.Community. PUT /api/pastes/:slug (owner or staff): the fields to change, at least one (else 400 Nothing to update); content only on a text paste; pinned only from staff. POST /api/pastes/:slug/comments: { message, parent_id?, anon_name? } (message trimmed, at most 2000 characters; a reply to a reply is refused). DELETE /api/pastes/:slug, DELETE /api/pastes/:slug/comments/:id and POST /api/pastes/:slug/fork|like|copy take no body. Unknown fields are ignored.

Fields

This schema has no named fields.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: comment
{
  "message": "this saved me an hour",
  "parent_id": 91
}
Valid: fork-like-copy-delete
{}
Valid: update
{
  "title": "ffmpeg restream flags (fixed)",
  "visibility": "private"
}
Rejected: title-not-text
{
  "title": 42
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('community.paste-write-request@1', value);   // { valid, errors: [{ path, message }] }