Skip to content

Dokument-Schema ​

Document: { meta?: object, blocks: Block[] } — nesting depth is capped at 20 levels.

Block (additionalProperties: false — exactly these keys):

KeyTypeRequiredNotes
idstringyes
typestringyes— pattern ^[a-z0-9_-]+$
enabledbooleanyes
dataobjectyes
settingsobjectyes
visibilityobjectyes
childrenarrayyes

Visibility: { from: string|null, until: string|null, sites: (int|string)[]|null } — all three keys required.

json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://www.renick.io/docs/content-plugin/schema/document-v1.json",
  "title": "Renick.Content document (v1)",
  "description": "A block-based content document as stored by the contenteditor field. Nesting depth is additionally capped at 20 levels (not expressible in JSON Schema).",
  "type": "object",
  "properties": {
    "meta": {
      "type": "object"
    },
    "blocks": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/block"
      }
    }
  },
  "required": [
    "blocks"
  ],
  "additionalProperties": false,
  "definitions": {
    "block": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "pattern": "^[a-z0-9_-]+$"
        },
        "enabled": {
          "type": "boolean"
        },
        "data": {
          "type": "object"
        },
        "settings": {
          "type": "object"
        },
        "visibility": {
          "type": "object",
          "properties": {
            "from": {
              "type": [
                "string",
                "null"
              ]
            },
            "until": {
              "type": [
                "string",
                "null"
              ]
            },
            "sites": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": [
                  "integer",
                  "string"
                ]
              }
            }
          },
          "required": [
            "from",
            "until",
            "sites"
          ],
          "additionalProperties": false
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/block"
          }
        }
      },
      "required": [
        "id",
        "type",
        "enabled",
        "data",
        "settings",
        "visibility",
        "children"
      ],
      "additionalProperties": false
    }
  }
}