Skip to content

Commit

Permalink
fix: allow value type Number for Number fields
Browse files Browse the repository at this point in the history
closes #138
  • Loading branch information
marstamm committed Mar 4, 2024
1 parent 31969ba commit fcb5a16
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,41 @@
"choices"
]
}
},
},
{
"$ref": "condition.json"
},
{
"if": {
"properties": {
"type": {
"not": {
"const": "Number"
}
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"value": {
"type": [
"string",
"boolean"
]
}
}
}
}
],
"properties": {
"value": {
"$id": "#/properties/property/value",
"type": [
"string",
"number",
"boolean"
],
"description": "The value of a control field."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const errors = [
{
keyword: 'type',
dataPath: '/properties/0/value',
schemaPath: '#/allOf/0/items/properties/value/type',
schemaPath: '#/allOf/0/items/allOf/2/then/properties/value/type',
params: {
type: [
'string',
Expand All @@ -30,6 +30,15 @@ export const errors = [
},
message: 'should be string,boolean'
},
{
dataPath: '/properties/0',
keyword: 'if',
message: 'should match "then" schema',
params: {
failingKeyword: 'then'
},
schemaPath: '#/allOf/0/items/allOf/2/if'
},
{
dataPath: '',
keyword: 'type',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ export const template = {
'type': 'property',
'name': 'name'
}
},
{
'label': 'Am I awesome?',
'type': 'Number',
'value': 50,
'binding': {
'type': 'zeebe:property',
'name': 'customProp'
}
}
]
};
Expand All @@ -21,7 +30,7 @@ export const errors = [
{
keyword: 'type',
dataPath: '/properties/0/value',
schemaPath: '#/allOf/0/items/properties/value/type',
schemaPath: '#/allOf/0/items/allOf/2/then/properties/value/type',
params: {
type: [
'string',
Expand All @@ -30,6 +39,15 @@ export const errors = [
},
message: 'should be string,boolean'
},
{
dataPath: '/properties/0',
keyword: 'if',
message: 'should match "then" schema',
params: {
failingKeyword: 'then'
},
schemaPath: '#/allOf/0/items/allOf/2/if'
},
{
dataPath: '',
keyword: 'type',
Expand Down

0 comments on commit fcb5a16

Please sign in to comment.