Hoping someone could point out any obvious mistakes here.
This is a cut down example but I am loading a default template into the JsonForms component with the appropriate schema/uischema:
template.json
"vehicle_type": null
schema.json
"vehicle_type": {
"type": ["string", "null"],
"title": "What is the vehicle type?",
"enum": ["Option1", "Option2", "Option3", "Option4", "Option5"]
}
uischema.json
{
"type": "Control",
"scope": "#/properties/Summary/properties/vehicle_description/properties/vehicle_type"
}
As requested a select is displayed on load with a blank (null) value and clicking it shows the enum options. However validation state:
must be equal to one of the allowed values
I’m loading a complete template with nulls in place as there didn’t appear to be an out of the box function to output the json including all the fields that weren’t entered (I have about 450 fields on this form). I’m not have any problems with multi-selects, integers or strings however selects all exhibit this behaviour.
I have also tried the following any the same issue is exhibited:
schema.json
"vehicle_type": {
"anyof": [{ "type": "string" }, { "type": "null" }],
"title": "What is the vehicle type?",
"enum": ["Option1", "Option2", "Option3", "Option4", "Option5"]
}
Any help greatly appreciated.
Rob.