Skip to content

Commit

Permalink
fix: enforce string value for feel: required
Browse files Browse the repository at this point in the history
  • Loading branch information
marstamm committed Mar 4, 2024
1 parent 762d6d2 commit 29e8d31
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,25 @@
}
}
}
},
{
"if": {
"properties": {
"feel": {
"const": "required"
}
},
"required": [
"feel"
]
},
"then": {
"properties": {
"value": {
"type": "string"
}
}
}
}
],
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
export const template = {
name: 'Pattern Template',
id: 'com.example.PatternTemplate',
appliesTo: [
'bpmn:Task'
],
properties: [
{
type: 'Text',
binding: {
type: 'zeebe:property',
name: 'prop'
},
feel: 'required',
value: 'valid'
},
{
type: 'Boolean',
binding: {
type: 'zeebe:property',
name: 'prop'
},
feel: 'required',
value: true
},
{
type: 'Number',
binding: {
type: 'zeebe:property',
name: 'prop'
},
feel: 'required',
value: 123
},
]
};

export const errors = [
{
keyword: 'type',
dataPath: '/properties/1/value',
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/type',
params: { type: 'string' },
message: 'should be string'
},
{
keyword: 'if',
dataPath: '/properties/1',
schemaPath: '#/allOf/1/items/allOf/9/if',
params: { failingKeyword: 'then' },
message: 'should match "then" schema'
},
{
keyword: 'type',
dataPath: '/properties/2/value',
schemaPath: '#/allOf/1/items/allOf/9/then/properties/value/type',
params: { type: 'string' },
message: 'should be string'
},
{
keyword: 'if',
dataPath: '/properties/2',
schemaPath: '#/allOf/1/items/allOf/9/if',
params: { failingKeyword: 'then' },
message: 'should match "then" schema'
},
{
keyword: 'type',
dataPath: '',
schemaPath: '#/oneOf/1/type',
params: { type: 'array' },
message: 'should be array'
},
{
keyword: 'oneOf',
dataPath: '',
schemaPath: '#/oneOf',
params: { passingSchemas: null },
message: 'should match exactly one schema in oneOf'
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ describe('validation', function() {
testTemplate('feel-type-mismatch');


testTemplate('feel-value-mismatch');


testTemplate('language');


Expand Down

0 comments on commit 29e8d31

Please sign in to comment.