UNPKG

@camunda/element-templates-json-schema-shared

Version:

Shared schema definitions used within element-templates-json-schema

138 lines (137 loc) 3.37 kB
{ "definitions": { "condition": { "type": "object", "required": [ "property" ], "properties": { "type": { "$id": "#/condition/type", "const": "simple", "description": "Defines the type of the condition (always \"simple\").", "default": "simple" }, "property": { "$id": "#/condition/property", "type": "string", "description": "Reference to the property used to evaluate the condition." } }, "oneOf": [ { "description": "Checks if the referenced property's value is in the list of values defined in the condition.", "properties": { "equals": { "description": "Checks if the referenced property's value is equal to the value defined in the condition.", "type": [ "string", "number", "boolean" ] } }, "required": [ "equals" ] }, { "properties": { "oneOf": { "type": "array", "items": { "type": [ "string", "number" ] } } }, "required": [ "oneOf" ] }, { "properties": { "isActive": { "type": "boolean", "description": "Checks if the referenced property is currently active and not hidden by other conditions." } }, "required": [ "isActive" ] } ] }, "conditionDependingOnId": { "required": [ "property" ], "properties": { "property": { "const": { "$data": "2/id" } } } } }, "allOf": [ { "$comment": "property#condition should not depend on property#id", "if": { "required": [ "id", "condition" ], "properties": { "condition": { "$ref": "#/definitions/conditionDependingOnId" } } }, "then": { "not": { "required": [ "condition" ] } } } ], "properties": { "id": { "type": "string", "description": "Unique identifier of the property. Can be used to, for example, reference the property for checks." }, "condition": { "type": "object", "description": "Object that defines when a property should be displayed in the properties panel and its value should be included in the XML.", "allOf": [ { "$ref": "examples.json#/condition" } ], "oneOf": [ { "$ref": "#/definitions/condition" }, { "properties": { "allMatch": { "$id": "#/allMatch", "type": "array", "items": { "$ref": "#/definitions/condition" }, "minItems": 1, "description": "List of conditions that must all be met for the property to be active." } }, "required": [ "allMatch" ] } ] } } }