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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | integer | yes | ||
thread_id | integer | string | yes | ||
parent_id | integer | null | yes | ||
origin | string | yes | ||
author | object | null | yes | ||
anon_name | string | null | |||
display_name | string | null | |||
message | string | null | yes |
| |
deleted | boolean | yes | ||
score | integer | yes | ||
upvotes | integer |
| ||
downvotes | integer |
| ||
my_vote | enum | yes |
| |
reply_count | integer | null | |||
created_at | string | null |
| ||
updated_at | string | null |
| ||
edited_at | string | null |
| ||
can_edit | boolean | yes | ||
can_delete | boolean | yes | ||
replies | array 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 }] }