# oneOf / Multiple different Objects in Array in Angular

**URL:** <https://jsonforms.discourse.group/t/oneof-multiple-different-objects-in-array-in-angular/1412>\
**Category:** General\
**Created:** [March 29, 2023, 10:16am UTC](https://jsonforms.discourse.group/t/oneof-multiple-different-objects-in-array-in-angular/1412 "2023-03-29T10:16:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zrag](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/zrag/32/688_2.png) [@Zrag](https://jsonforms.discourse.group/u/Zrag)\
**Post date:** [March 29, 2023, 10:16am UTC](https://jsonforms.discourse.group/t/oneof-multiple-different-objects-in-array-in-angular/1412/1 "2023-03-29T10:16:35Z")

</div>

Hi there,

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?

Thank you!

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [March 29, 2023, 12:22pm UTC](https://jsonforms.discourse.group/t/oneof-multiple-different-objects-in-array-in-angular/1412/2 "2023-03-29T12:22:21Z")

</div>

Hi!

> [@Zrag](#):
>
> 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!”.

Our renderer sets have different capatibilities, not all of them can handle `oneOf`.

> [@Zrag](#):
>
> 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?

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](https://github.com/eclipsesource/jsonforms/blob/229d99a9a8a79a95549b2eae2a11037a5515997f/packages/core/src/generators/schema.ts). By copying and modifying to your needs you can avoid the `oneOf`.
