Skip to content

Commit 8233625

Browse files
fix: mark feel: required that does not start with = as deprecated
Related to camunda/camunda-modeler#4967
1 parent 1a078fa commit 8233625

File tree

2 files changed

+71
-5
lines changed

2 files changed

+71
-5
lines changed

packages/zeebe-element-templates-json-schema/src/defs/properties.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,19 @@
277277
"then": {
278278
"properties": {
279279
"value": {
280-
"type": "string"
280+
"oneOf": [
281+
{
282+
"type": "string",
283+
"pattern": "^="
284+
},
285+
{
286+
"type": "string",
287+
"not": {
288+
"pattern": "^="
289+
},
290+
"deprecated": true
291+
}
292+
]
281293
}
282294
}
283295
}

packages/zeebe-element-templates-json-schema/test/fixtures/feel-value-mismatch.js

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,37 @@ export const errors = [
3939
{
4040
keyword: 'type',
4141
dataPath: '/properties/1/value',
42-
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/type',
43-
params: { type: 'string' },
42+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/0/type',
43+
params: {
44+
type: 'string'
45+
},
46+
message: 'should be string'
47+
},
48+
{
49+
keyword: 'type',
50+
dataPath: '/properties/1/value',
51+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/type',
52+
params: {
53+
type: 'string'
54+
},
4455
message: 'should be string'
4556
},
57+
{
58+
keyword: 'not',
59+
dataPath: '/properties/1/value',
60+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/not',
61+
params: {},
62+
message: 'should NOT be valid'
63+
},
64+
{
65+
keyword: 'oneOf',
66+
dataPath: '/properties/1/value',
67+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf',
68+
params: {
69+
passingSchemas: null
70+
},
71+
message: 'should match exactly one schema in oneOf'
72+
},
4673
{
4774
keyword: 'if',
4875
dataPath: '/properties/1',
@@ -53,10 +80,37 @@ export const errors = [
5380
{
5481
keyword: 'type',
5582
dataPath: '/properties/2/value',
56-
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/type',
57-
params: { type: 'string' },
83+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/0/type',
84+
params: {
85+
type: 'string'
86+
},
87+
message: 'should be string'
88+
},
89+
{
90+
keyword: 'type',
91+
dataPath: '/properties/2/value',
92+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/type',
93+
params: {
94+
type: 'string'
95+
},
5896
message: 'should be string'
5997
},
98+
{
99+
keyword: 'not',
100+
dataPath: '/properties/2/value',
101+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf/1/not',
102+
params: {},
103+
message: 'should NOT be valid'
104+
},
105+
{
106+
keyword: 'oneOf',
107+
dataPath: '/properties/2/value',
108+
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/oneOf',
109+
params: {
110+
passingSchemas: null
111+
},
112+
message: 'should match exactly one schema in oneOf'
113+
},
60114
{
61115
keyword: 'if',
62116
dataPath: '/properties/2',

0 commit comments

Comments
 (0)