{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "JSON Schema tibi-server collection configuration", "description": "tibi-server collection configuration", "type": "object", "additionalProperties": false, "patternProperties": { "^x\\-": { "description": "template property" } }, "properties": { "name": { "type": "string", "description": "collection name, part of api path" }, "defaultLanguage": { "type": "string", "description": "default language for database text index" }, "uploadPath": { "type": "string", "description": "relative to config.yml, path for file uploads" }, "upload": { "type": "object", "description": "collection-specific upload defaults and restrictions", "additionalProperties": false, "properties": { "maxBodySize": { "type": "string", "description": "request body size limit override for this collection (e.g. '10MB')" }, "allowedMimeTypes": { "type": "array", "description": "allowed MIME types for file uploads in this collection; empty means all types are allowed", "items": { "type": "string" } } } }, "meta": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "type": "object", "description": "meta object used for admin ui configuration", "additionalProperties": true, "allOf": [ { "$ref": "collectionNavigation.json" } ], "properties": { "rowIdentTpl": { "description": "template which evaluates to short string to identify entry in pe. select boxes", "$ref": "definitions.json#/definitions/evalExpressions" }, "subNavigation": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "type": "array", "description": "sub navigation of collection", "items": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "$ref": "collectionNavigation.json" } ] } } ] }, "pagebuilder": { "type": "object", "description": "Collection-level pagebuilder defaults. These serve as fallbacks when field-level pagebuilder config omits them.", "additionalProperties": false, "properties": { "blockTypeField": { "type": "string", "description": "Name of the sub-field that holds the block type identifier. Default: 'blockType'. Used as fallback for all pagebuilder fields in this collection." }, "blockRegistry": { "type": "object", "description": "Block registry configuration.", "additionalProperties": false, "properties": { "file": { "type": "string", "description": "URL to an ES module that default-exports a BlockRegistry. Used as fallback for all pagebuilder fields in this collection." } } } } } } } ] }, "projections": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "$ref": "projections.json" } ] }, "permissions": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "$ref": "permissions.json" } ] }, "hooks": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "$ref": "hooks.json" } ] }, "imageFilter": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "$ref": "imageFilter.json" } ] }, "fields": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "type": "array", "description": "fields of collection", "items": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "$ref": "field.json" } ] } } ] }, "indexes": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "type": "array", "description": "indexes of collection", "items": { "oneOf": [ { "$comment": "for include tag", "type": "string" }, { "$ref": "index.json" } ] } } ] }, "bulk": { "type": "object", "description": "bulk operation configuration", "additionalProperties": false, "properties": { "optimize": { "type": "object", "description": "enable optimised single-DB-call bulk path without requiring a hook file", "additionalProperties": false, "properties": { "create": { "type": "boolean", "description": "POST with JSON array uses optimised InsertMany path" }, "update": { "type": "boolean", "description": "PUT without ID uses optimised path" }, "delete": { "type": "boolean", "description": "DELETE without ID uses optimised path" } } } } }, "cors": { "type": "object", "description": "cors configuration", "additionalProperties": false, "properties": { "merge": { "type": "boolean", "description": "merge with global and project cors configuration" }, "allowOrigins": { "type": "array", "description": "list of allowed origins", "items": { "type": "string" } }, "allowMethods": { "type": "array", "description": "list of allowed methods", "items": { "type": "string" } }, "allowHeaders": { "type": "array", "description": "list of allowed headers", "items": { "type": "string" } }, "allowCredentials": { "type": "boolean", "description": "allow credentials" }, "exposeHeaders": { "type": "array", "description": "list of exposed headers", "items": { "type": "string" } }, "maxAge": { "type": "integer", "description": "max age in seconds" } } }, "audit": { "type": "object", "description": "audit logging configuration for this collection", "additionalProperties": false, "properties": { "enabled": { "type": "boolean", "description": "enable audit logging for this collection" }, "actions": { "type": "array", "description": "list of actions to audit (create, update, delete, bulkCreate, bulkUpdate, bulkDelete, get)", "items": { "type": "string", "enum": [ "create", "update", "delete", "bulkCreate", "bulkUpdate", "bulkDelete", "get" ] } } } }, "queryLimits": { "type": "object", "description": "query limit configuration for GET requests", "additionalProperties": false, "properties": { "defaultLimit": { "type": "integer", "description": "default limit for GET queries if client doesn't specify one" }, "maxLimit": { "type": "integer", "description": "maximum allowed limit for GET queries" } } }, "readonlyFields": { "type": "array", "description": "fields that are read-only at collection level", "items": { "type": "string" } }, "hiddenFields": { "type": "array", "description": "fields that are hidden at collection level", "items": { "type": "string" } }, "search": { "type": "array", "description": "search configurations for the collection", "items": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string", "description": "search config name (used in query parameter qName)" }, "mode": { "type": "string", "description": "search mode", "enum": [ "text", "regex", "eval", "filter" ] }, "fields": { "type": "array", "description": "fields to search in (for text/regex mode)", "items": { "type": "string" } }, "meta": { "type": "object", "description": "meta information", "additionalProperties": true }, "eval": { "type": "string", "description": "JS eval expression (for eval mode)" }, "filter": { "type": "object", "description": "MongoDB filter template (for filter mode)", "additionalProperties": true } }, "required": [ "name", "mode" ] } }, "strictFields": { "type": "boolean", "description": "reject unknown fields not defined in the fields array" } }, "required": [ "name", "permissions" ] }