NewsPerspectiveUpdateRequest news.perspective-update-request@1

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

Version
1.0.0
Owner
news
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/news/perspective-update-request.v1.json

news.perspective-update-request@1: bodies of news.perspective.update on OpenVibe.News (editors). POST /api/v1/stories/:id/perspectives { label, description? } adds an editor-labelled perspective (labels are written by editors, never generated; 422 perspective.no_label, 422 perspective.label_too_long over 80 characters; the description is cut to 500). PUT /api/v1/stories/:id/sources/:item/perspective { perspective } puts an attached source in a perspective (per_…) or in none (null or absent; 404 story.source_not_attached, 404 perspective.not_found). DELETE /api/v1/stories/:id/perspectives/:pid takes no body.

Fields

This schema has no named fields.

Examples

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

Valid: add
{
  "label": "Council statements",
  "description": "What the council has said"
}
Valid: assign
{
  "perspective": "per_01JAB4P5Q6R7S8T9V0W1X2Y3Z4"
}
Valid: remove
{}
Valid: unassign
{
  "perspective": null
}
Rejected: wrong-types
{
  "label": 42,
  "perspective": 7
}

Validate

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