I’m trying to display multiple objects in Arrays. The schema und schemaUI are generated by JSON forms.
It works as long:
All objects inside the array have the identical keys
Its not working anymore, if there are different objects inside the Array. Then the generated schema will include a key called oneOf and I can read “No applicable renderer found!”.
I checked this board and the only answer I found was “Its easy, just write a renderer yourself”. As far as I understand that all of this is free and I thank you a lot in advance for taking the time to answer my question, if I could go that extra mile alone, I wouldnt need your help.
Is it possible, instead of writing an own renderer, to just give the generateSchema function the option, to not use oneOf / to use list instead of table? All I can find in the documentation is “you can pass any options”. But what options are there?
Our renderer sets have different capatibilities, not all of them can handle oneOf.
If you already know how the array should look like I would recommend not relying on the generateSchema functionality but specifying and handing over the JSON Schema yourself. The generateSchema is very simple as there is not much one can defer from a simple data object. It’s therefore meant to get you started quickly, but in production it is seldom used. The generateUISchema functionality however is often very useful and also used in practice.
In case you want to keep using the approach of also generating the schema I would like to recommend to just implement an own schema generator. The generator is very simple code. By copying and modifying to your needs you can avoid the oneOf.