NewsTopicManageRequest news.topic-manage-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/topic-manage-request.v1.json
news.topic-manage-request@1: the body of news.topic.manage on OpenVibe.News: POST /api/v1/topics { name, slug?, description? } adds a canonical topic (editors; a service acts for the editor in X-OV-Subject). The name is collapsed and cut to 80 characters, the description to 300; the slug is made from slug or name (422 topic.no_name without a name, 422 topic.invalid_slug when it has no letters or digits).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
name | string | yes |
| |
slug | string | |||
description | string | null |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: topic
{
"name": "Local",
"slug": "local",
"description": "Stories from the harbour towns"
}Rejected: no-name
{
"slug": "local"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('news.topic-manage-request@1', value); // { valid, errors: [{ path, message }] }