BlogBlogConfigureRequest blog.blog-configure-request@1

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

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

blog.blog-configure-request@1: the body of PATCH /api/v1/blogs/:handle on OpenVibe.Blog (blog.blog.configure; an owner): title (at most 120 characters, not blank), description (500), language (a BCP 47 tag) and feeds { rss, atom, json, item_count (1-50), full_content }. Fields left out keep their value.

Fields

FieldTypeRequiredDescriptionConstraints
titlestring | null
descriptionstring | null
languagestring | null
  • pattern ^[a-zA-Z]{2,3}(-[A-Za-z0-9]{2,8})*$
feedsobject
feeds.rssboolean | integer | string
feeds.atomboolean | integer | string
feeds.jsonboolean | integer | string
feeds.item_countinteger | string
  • pattern ^[0-9]+$
  • minimum 1
  • maximum 50
feeds.full_contentboolean | integer | string

Examples

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

Valid: configure
{
  "description": "Garage projects, stream tech and the odd recipe.",
  "language": "en-GB",
  "feeds": {
    "rss": true,
    "atom": false,
    "item_count": 30
  }
}
Rejected: bad-language
{
  "language": "English"
}

Validate

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