CommunityCommentWriteRequest community.comment-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/comment-write-request.v1.json

community.comment-write-request@1: bodies of community.comment.write on OpenVibe.Community (people, anonymous people with a name where the thread allows it, and services acting as X-OV-Subject or as AI). POST /api/v1/comments/threads/resolve: { ref } — get or create the thread of an entity (browsers only for the allow-listed entity types; a label is taken only from a service). POST /api/v1/comments/threads/:id/comments: { message, parent_id?, anon_name? } (message trimmed, at most 5000 characters; a reply to a reply joins the top-level comment). POST /api/v1/comments/:commentId/votes: { value: 1 | -1 | 0 } (people). GET /api/v1/comments/threads/:id and DELETE /api/v1/comments/:commentId 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: reply
{
  "message": "That ending!",
  "parent_id": 810
}
Valid: resolve
{
  "ref": {
    "service": "live",
    "type": "vod",
    "id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  }
}
Rejected: bad
{
  "message": "   ",
  "value": 3,
  "ref": "live:vod:1"
}

Validate

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