Use default renderer when given schemata is missing data properties

Hi @syncthetic,

This is an interesting use case. In general I can see two options to tackle the issue:

  1. Handle it outside of JSON Forms: When you receive new external data which is not part of the already used JSON Schema and UI Schema, adapt the JSON Schema and UI Schema to include the new data. How straightforward this is depends on the JSON Schemas, UI Schemas and custom renderers you employ.
  2. Use custom renderer: You need a custom renderer whose responsibility is to identify data which is not part of the JSON Schema and UI Schema, generate those sub schemas locally and then dispatch back to JSON Forms using the generated sub schemas.
    A simple approach would be a custom type: object renderer which just shallowly checks the data and sub schemas and adds missing properties accordingly. However this only works if your UI schemas are designed in a way that all objects are represented by object controls and each object control is responsible for all properties of its object.
    Should you have more complicated UI Schema setups you accordingly need more and/or complex custom renderers.

In general I can see both approaches working. I don’t necessarily see the need for custom renderers here, so without knowing your exact requirements I would probably suggest to first evaluate the first approach. This would also help you in case you wanted to integrate with other JSON Schema based tools.
If you also have use cases like using patternProperties where you need a similar custom renderer anyway you could also look into that first.