WikiCitationAttachRequest wiki.citation-attach-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- wiki
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/wiki/citation-attach-request.v1.json
wiki.citation-attach-request@1: the body of POST /api/v1/pages/:id/revisions/:n/citations on OpenVibe.Wiki (wiki.citation.attach, editors): sources for the newest revision while it is unpublished (a published revision's sources are fixed: 409 citation.revision_published; an older one is 409 citation.not_head). A URL citation needs retrieved_at; a Sources item id brings its own URL, title and retrieval time.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
citations | array of object | yes | At most 50. Each needs a URL (with retrieved_at) or a Sources item id (url, title and retrieval come from the item). |
|
citations[].url | string | null | |||
citations[].title | string | null | |||
citations[].source_item_id | string | null | |||
citations[].retrieved_at | string | null | |||
citations[].quote | one of | Cut to 5000 characters. | ||
citations[].license_note | string | null | |||
citations[].anchor | string | null |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: sources-item
{
"citations": [
{
"source_item_id": "itm_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"quote": "RTMP runs over TCP."
}
]
}Rejected: not-a-list
{
"citations": "https://example.com"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('wiki.citation-attach-request@1', value); // { valid, errors: [{ path, message }] }