CTZN.network Schemas Video Devlog

Topic Records View json-view

ctzn.network/topic-records-view

Get records which have been tagged for a given topic.

{
  "id": "ctzn.network/topic-records-view",
  "title": "Topic Records View",
  "description": "Get records which have been tagged for a given topic.",
  "type": "json-view",
  "parameters": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "array",
    "minItems": 1,
    "additionalItems": false,
    "items": [
      {
        "$comment": "The topic",
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "[A-Za-z0-9_-]+"
      },
      {
        "$comment": "The data source (defaults to 'follows', may be a user ID)",
        "type": "string"
      }
    ]
  },
  "definition": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "required": [
      "topic",
      "records"
    ],
    "properties": {
      "topic": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "[a-z0-9_-]+"
      },
      "records": {
        "type": "object",
        "$comment": "A map of {schemaId => [records]}",
        "patternProperties": {
          ".*": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "seq",
                "key",
                "url",
                "author",
                "value",
                "taggedBy"
              ],
              "properties": {
                "seq": {
                  "type": "number"
                },
                "key": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "author": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string",
                      "pattern": ".+@.+"
                    },
                    "displayName": {
                      "type": "string"
                    }
                  }
                },
                "value": {
                  "$comment": "Will vary by the record schema",
                  "type": "object"
                },
                "taggedBy": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": ".+@.+"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Schemas

tag