From 787cad35b4573b96a12aa27a1224d1c54d0cfc32 Mon Sep 17 00:00:00 2001 From: Jarek Danielak Date: Fri, 29 Aug 2025 13:28:46 +0200 Subject: [PATCH] fix: mark `feel: required` that does not start with `=` as `deprecated` Related to https://github.com/camunda/camunda-modeler/issues/4967 --- .../src/defs/properties.json | 14 ++++- .../test/fixtures/feel-value-mismatch.js | 62 +++++++++++++++++-- 2 files changed, 71 insertions(+), 5 deletions(-) diff --git a/packages/zeebe-element-templates-json-schema/src/defs/properties.json b/packages/zeebe-element-templates-json-schema/src/defs/properties.json index 896f0e87..6f140a28 100644 --- a/packages/zeebe-element-templates-json-schema/src/defs/properties.json +++ b/packages/zeebe-element-templates-json-schema/src/defs/properties.json @@ -277,7 +277,19 @@ "then": { "properties": { "value": { - "type": "string" + "oneOf": [ + { + "type": "string", + "pattern": "^=" + }, + { + "type": "string", + "not": { + "pattern": "^=" + }, + "deprecated": true + } + ] } } } diff --git a/packages/zeebe-element-templates-json-schema/test/fixtures/feel-value-mismatch.js b/packages/zeebe-element-templates-json-schema/test/fixtures/feel-value-mismatch.js index 191ed5ff..241fe4cc 100644 --- a/packages/zeebe-element-templates-json-schema/test/fixtures/feel-value-mismatch.js +++ b/packages/zeebe-element-templates-json-schema/test/fixtures/feel-value-mismatch.js @@ -39,10 +39,37 @@ export const errors = [ { keyword: 'type', dataPath: '/properties/1/value', - schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/type', - params: { type: 'string' }, + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }, + { + keyword: 'type', + dataPath: '/properties/1/value', + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/type', + params: { + type: 'string' + }, message: 'should be string' }, + { + keyword: 'not', + dataPath: '/properties/1/value', + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/not', + params: {}, + message: 'should NOT be valid' + }, + { + keyword: 'oneOf', + dataPath: '/properties/1/value', + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf', + params: { + passingSchemas: null + }, + message: 'should match exactly one schema in oneOf' + }, { keyword: 'if', dataPath: '/properties/1', @@ -53,10 +80,37 @@ export const errors = [ { keyword: 'type', dataPath: '/properties/2/value', - schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/type', - params: { type: 'string' }, + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }, + { + keyword: 'type', + dataPath: '/properties/2/value', + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/type', + params: { + type: 'string' + }, message: 'should be string' }, + { + keyword: 'not', + dataPath: '/properties/2/value', + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/not', + params: {}, + message: 'should NOT be valid' + }, + { + keyword: 'oneOf', + dataPath: '/properties/2/value', + schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf', + params: { + passingSchemas: null + }, + message: 'should match exactly one schema in oneOf' + }, { keyword: 'if', dataPath: '/properties/2',