{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://docs.rudder.io/schemas/technique.schema.json", "title": "Rudder Technique", "description": "A Rudder technique", "type": "object", "required": [ "id", "name", "version", "items" ], "additionalProperties": false, "properties": { "format": { "type": "number" }, "id": { "$ref": "#/$defs/techniqueId" }, "description": { "type": "string" }, "documentation": { "type": "string", "format": "markdown" }, "tags": { "$ref": "#/$defs/tags" }, "params": { "type": "array", "items": { "$ref": "#/$defs/techniqueParameter" } }, "name": { "type": "string" }, "category": { "type": "string" }, "version": { "$ref": "#/$defs/techniqueVersion" }, "items": { "type": "array", "items": { "$ref": "#/$defs/item" } } }, "$defs": { "uuid": { "type": "string", "format": "uuid" }, "techniqueParameterName": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, "techniqueVersion": { "type": "string", "pattern": "^[0-9]+\\.[0-9]$" }, "techniqueId": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, "techniqueParameter": { "type": "object", "required": [ "name" ], "additionalProperties": false, "properties": { "id": { "$ref": "#/$defs/uuid" }, "description": { "type": "string" }, "documentation": { "type": "string", "format": "markdown" }, "name": { "$ref": "#/$defs/techniqueParameterName" }, "type": { "type": "string", "enum": [ null, "string", "multiline-string", "json", "yaml", "boolean", "mail", "ip", "ipv4", "ipv6", "integer", "size-b", "size-kb", "size-mb", "size-gb", "size-tb", "permissions", "shared-file", "password" ] }, "default": { "type": [ "string", "boolean", "number" ] }, "constraints": { "type": "object", "properties": { "allow_empty": { "type": "boolean" }, "password_hashes": { "type": "array", "items": { "type": "string", "enum": [ null, "pre-hashed", "plain", "unix-crypt-des", "md5", "sha1", "sha256", "sha512", "md5-crypt", "sha256-crypt", "sha512-crypt", "md5-crypt-aix", "sha256-crypt-aix", "sha512-crypt-aix" ] } }, "regex": { "type": "object", "required": [ "value" ], "properties": { "value": { "type": "string", "format": "regex" }, "error_message": { "type": "string" } } }, "select": { "type": "array", "items": { "type": "object", "required": [ "value" ], "properties": { "name": { "type": "string" }, "value": { "type": "string" } } } } } } } }, "tags": { "type": "object" }, "reportingMode": { "oneOf": [ { "type": "object", "properties": { "mode": { "enum": [ "worst-case-weighted-one", "worst-case-weighted-sum", "disabled", "enabled", "weighted" ] } }, "required": [ "mode" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "$ref": "#/$defs/uuid" }, "mode": { "const": "focus" } }, "required": [ "mode", "id" ], "additionalProperties": false } ] }, "item": { "properties": { "name": { "type": "string" }, "id": { "$ref": "#/$defs/uuid" }, "tags": { "$ref": "#/$defs/tags" }, "condition": { "type": ["string", "boolean"] }, "reporting": { "$ref": "#/$defs/reportingMode" }, "method": { "type": "string" }, "params": { "type": "object" }, "items": { "type": "array", "items": { "$ref": "#/$defs/item" } } }, "additionalProperties": false, "not": { "anyOf": [ { "required": [ "params", "items" ] }, { "required": [ "method", "items" ] } ] }, "dependencies": { "params": [ "method" ], "method": [ "params" ] } } } }