CommunityComment community.comment@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.v1.json

community.comment@1: one comment in an embeddable comment thread on OpenVibe.Community (server/comments/service.js shapeComment), with its author (or anonymous name), score and the caller's vote, reply count and, for top-level comments in a page, the first replies. A deleted comment keeps its place with no author or message.

Fields

FieldTypeRequiredDescriptionConstraints
idintegeryes
thread_idinteger | stringyes
parent_idinteger | nullyes
originstringyes
authorobject | nullyes
anon_namestring | null
display_namestring | null
messagestring | nullyes
  • maxLength 5000
deletedbooleanyes
scoreintegeryes
upvotesinteger
  • minimum 0
downvotesinteger
  • minimum 0
my_voteenumyes
  • one of 1, -1, 0
reply_countinteger | null
created_atstring | null
  • format date-time
updated_atstring | null
  • format date-time
edited_atstring | null
  • format date-time
can_editbooleanyes
can_deletebooleanyes
repliesarray of object

Examples

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

Valid: comment
{
  "id": 812,
  "thread_id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "parent_id": null,
  "origin": "user",
  "author": {
    "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "username": "alice",
    "display_name": "Alice",
    "avatar_url": null,
    "profile_color": null
  },
  "anon_name": null,
  "display_name": "Alice",
  "message": "That ending!",
  "deleted": false,
  "score": 2,
  "upvotes": 2,
  "downvotes": 0,
  "my_vote": 0,
  "reply_count": 0,
  "created_at": "2026-09-25T18:00:00.000Z",
  "updated_at": "2026-09-25T18:00:00.000Z",
  "edited_at": null,
  "can_edit": false,
  "can_delete": false
}
Rejected: bad-vote
{
  "id": 812,
  "thread_id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "parent_id": null,
  "origin": "user",
  "author": {
    "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "username": "alice",
    "display_name": "Alice",
    "avatar_url": null,
    "profile_color": null
  },
  "anon_name": null,
  "display_name": "Alice",
  "message": "That ending!",
  "deleted": false,
  "score": 2,
  "upvotes": 2,
  "downvotes": 0,
  "my_vote": 5,
  "reply_count": 0,
  "created_at": "2026-09-25T18:00:00.000Z",
  "updated_at": "2026-09-25T18:00:00.000Z",
  "edited_at": null,
  "can_edit": false,
  "can_delete": false
}

Validate

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