'No applicable renderer found' error when auto generating uischema for schema with nested object (vue)

Hi,

I am trying to use the automatically generated uischema through only the schema.
Using some simple schema as an example below, the input field for ‘name’ can be rendered, but below that the long description object just shows ‘No applicable renderer found.’

schema= {
  'properties': {
    'name': {
      'type': "string",
      'minLength': 1,
      'description': "The task's name"
    },
    'description': {
      'title': "Long Description",
      'type': "object",
      'required':[
        "leader",
        "estimated_price",
        "status"
      ],
      "properties":{
        "leader":{
          "type":"string"
        },
        "estimated_price":{
          "type":"number"
        },
        "status":{
          "type":"boolean"
        }
      }
    }
  }
}

I am just copying the vue2 seed example on how they declare renderer in my example:
(jsonforms-vue-seed/App.vue at vue2 · eclipsesource/jsonforms-vue-seed · GitHub)

const renderers = [
  ...vanillaRenderers
  // here you can add custom renderers
];
//under data()
renderers: Object.freeze(renderers)

Am I doing something wrong? Should I be using a custom renderer? I know I can probably build a uischema manually to create the form properly, but I want to avoid that if possible

Hi @hugokhf,

the problem is that we don’t offer an object renderer at the moment, see also here. The ui schema generator just generates a Control for each property including description. The rendering then “fails” as there is no renderer handling the type: "object" schema.

To solve this you can implement your own object renderer which should be rather straightforward. You can basically copy the GroupRenderer, connect it with the useJsonFormsControlWithDetail composition (therefore also use control instead of layout to refer to the computed props) and use findUiSchema to find or generate the sub ui schema, like in the React Material object renderer.

1 Like

thanks a lot for the reply.

so since renderer do not support object, if I don’t create a custom one, but instead specify the uischema dynamically (i.e. parsing and storing properties found in schema manually, then create a function to push each properties as the ‘scope’ into the elements array within uischema)
I assume that will also do the job the same? Is that correct?

Thanks in advance

Yes absolutely. As a starting point you can copy the generator code from JSON Forms and adapt it to your needs.