SharePeopleLookup share.people-lookup@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
network
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/share/people-lookup.v1.json

share.people-lookup@1: the answer to GET /api/v1/share/people?name=exact. person is null when nobody holds that exact name, for banned or deleted accounts, and for non-user subjects.

Fields

FieldTypeRequiredDescriptionConstraints
personone ofyes

Examples

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

Valid: none
{
  "person": null
}
Valid: person
{
  "person": {
    "subject": {
      "type": "user",
      "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
    },
    "username": "maticus",
    "display_name": "Maticus",
    "avatar_url": "https://cdn.openvibe.network/avatars/maticus.png"
  }
}
Rejected: unknown-field
{
  "person": {
    "subject": {
      "type": "user",
      "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
    },
    "username": "maticus",
    "display_name": "Maticus",
    "avatar_url": null
  },
  "names": [
    "maticus"
  ]
}

Validate

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