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 896f0e8..6f140a2 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 191ed5f..241fe4c 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',