Hi, I’m trying to use the schema below with JsonForms. It generates my UI elements in React and will not me from submitting the form unless I have one of or both ‘toCurrencyCode’ or ‘fromCurrencyCode’ set.
This is fine, however there is no red error box or message appearing. The errors work when explicitly setting the fields as required but I only want them to be marked as an error when both are empty. Been scratching my head over this and it’s not the only approach I’ve tried.
Any help would be appreciated, thanks.
{
"schema": {
"type": "object",
"properties": {
"fromDate": {
"type": "string",
"format": "date",
"options": {
"isStrict": false,
"optionLabel": "name",
"optionValue": "value"
}
},
"toDate": {
"type": "string",
"format": "date",
"options": {
"isStrict": false,
"optionLabel": "name",
"optionValue": "value"
}
},
"fromCurrencyCode": {
"type": "string"
},
"toCurrencyCode": {
"type": "string"
},
"snapCode": {
"type": "string",
"enum": [
"Code1",
"Code2",
"Code3",
"Code4"
],
"options": {
"isStrict": false
}
}
},
"anyOf": [
{"required": ["fromCurrencyCode"]},
{"required": ["toCurrencyCode"]}
],
"required": [
"fromDate",
"toDate"
]
}
}