From 7992c4db0accf3233671fc0f31a356d8eb1592aa Mon Sep 17 00:00:00 2001 From: Tomas Date: Fri, 19 Jun 2026 08:31:38 +0200 Subject: [PATCH 1/2] feat: Update JSON Schema for expression component --- .../validators/expression.schema.v1.json | 55 +++++++++++++++++-- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json b/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json index 7cbf91e673f..66466188300 100644 --- a/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json +++ b/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json @@ -39,7 +39,10 @@ { "$ref": "#/definitions/strict-string" }, { "$ref": "#/definitions/strict-boolean" }, { "$ref": "#/definitions/strict-number" }, - { "$ref": "#/definitions/func-if" } + { "$ref": "#/definitions/func-if" }, + { "$ref": "#/definitions/func-component" }, + { "$ref": "#/definitions/func-dataModel" }, + { "$ref": "#/definitions/func-jmespath" } ] }, "string": { @@ -79,7 +82,8 @@ { "$ref": "#/definitions/func-stringSlice" }, { "$ref": "#/definitions/func-upperCaseFirst" }, { "$ref": "#/definitions/func-lowerCaseFirst" }, - { "$ref": "#/definitions/func-optionLabel" } + { "$ref": "#/definitions/func-optionLabel" }, + { "$ref": "#/definitions/func-jmespath" } ] }, "boolean": { @@ -118,7 +122,8 @@ { "$ref": "#/definitions/func-startsWith" }, { "$ref": "#/definitions/func-commaContains" }, { "$ref": "#/definitions/func-compare" }, - { "$ref": "#/definitions/func-compare-inverse" } + { "$ref": "#/definitions/func-compare-inverse" }, + { "$ref": "#/definitions/func-jmespath" } ] }, "number": { @@ -143,9 +148,26 @@ { "$ref": "#/definitions/func-multiply" }, { "$ref": "#/definitions/func-stringLength" }, { "$ref": "#/definitions/func-stringIndexOf" }, - { "$ref": "#/definitions/func-countDataElements" } + { "$ref": "#/definitions/func-countDataElements" }, + { "$ref": "#/definitions/func-jmespath" } ] }, + "list": { + "title": "Any expression returning a list", + "$ref": "#/definitions/strict-list" + }, + "strict-list": { + "title": "Any expression returning a list (strict)", + "anyOf": [{ "$ref": "#/definitions/func-list" }, { "$ref": "#/definitions/func-jmespath" }] + }, + "object": { + "title": "Any expression returning an object", + "$ref": "#/definitions/strict-object" + }, + "strict-object": { + "title": "Any expression returning an object (strict)", + "anyOf": [{ "$ref": "#/definitions/func-object" }, { "$ref": "#/definitions/func-jmespath" }] + }, "func-if": { "title": "If/else conditional expression", "description": "This function will evaluate and return the result of either branch. If else is not given, null will be returned instead.", @@ -634,6 +656,31 @@ ], "additionalItems": false }, + "func-list": { + "title": "Create a list", + "description": "This function creates a list from its arguments.", + "type": "array", + "items": [{ "const": "list" }], + "additionalItems": { "$ref": "#/definitions/any" } + }, + "func-object": { + "title": "Create an object", + "description": "This function creates an object from its arguments.", + "type": "array", + "items": [{ "const": "object" }], + "additionalItems": { "$ref": "#/definitions/any" } + }, + "func-jmespath": { + "title": "Run a Jmespath query", + "description": "This function runs a Jmespath query and returns the result. The first argument is the data to query, and the second is the Jmespath query string.", + "type": "array", + "items": [ + { "const": "jmespath" }, + { "$ref": "#/definitions/any" }, + { "$ref": "#/definitions/string" } + ], + "additionalItems": false + }, "compare-operator": { "title": "Comparison operator", "enum": [ From 04c9571e01e3f7e29542b8f50e724057e05e57e8 Mon Sep 17 00:00:00 2001 From: Tomas Date: Fri, 19 Jun 2026 11:02:46 +0200 Subject: [PATCH 2/2] Add missing lines --- .../StudioExpression/validators/expression.schema.v1.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json b/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json index 66466188300..6cacd1c1427 100644 --- a/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json +++ b/src/Designer/frontend/libs/studio-components/src/components/StudioExpression/validators/expression.schema.v1.json @@ -39,6 +39,8 @@ { "$ref": "#/definitions/strict-string" }, { "$ref": "#/definitions/strict-boolean" }, { "$ref": "#/definitions/strict-number" }, + { "$ref": "#/definitions/strict-list" }, + { "$ref": "#/definitions/strict-object" }, { "$ref": "#/definitions/func-if" }, { "$ref": "#/definitions/func-component" }, { "$ref": "#/definitions/func-dataModel" },