Skip to content

Description is not rendered for array type #2122

@hungbie

Description

@hungbie

Describe the bug

Normally, a description will be render for the field if they have description in their schema.
However, for field of type array, the description field is not being rendered.

Expected behavior

description being rendered.

Steps to reproduce the issue

Example code:

import React from 'react';
import { JsonForms } from '@jsonforms/react';
import {
  materialRenderers,
  materialCells,
} from '@jsonforms/material-renderers';

export default function ExampleJsonForm() {
  const schema = {
    type: 'object',
    description: 'This is a description of the object.',
    properties: {
      comments: {
        type: 'array',
        description: 'This is a description of the comments array.',
        items: {
          type: 'object',
          properties: {
            unfocusedDescription: {
              type: 'string',
              description: 'This description is shown even when the control is not focused',
            },
          },
        },
      },
      unfocusedDescription: {
        type: 'string',
        description: 'This description is shown even when the control is not focused',
      },
    },
  };
  const uischema = {
    type: 'VerticalLayout',
    elements: [
      {
        type: 'Control',
        scope: '#/properties/comments',
        options: {
          showUnfocusedDescription: true,
        },
      },
      {
        type: 'Control',
        scope: '#/properties/unfocusedDescription',
        options: {
          showUnfocusedDescription: true,
        },
      },
    ],
  };
  const data = {
  };
  return (
      <JsonForms
        schema={schema}
        uischema={uischema}
        data={data}
        renderers={materialRenderers}
        cells={materialCells}
      />
  );
}

Screenshots

Screenshot 2023-03-31 at 4 31 36 PM

In which browser are you experiencing the issue?

Google Chrome Version 111.0.5563.110 (Official Build) (x86_64)

Which Version of JSON Forms are you using?

v3.0.0

Framework

React

RendererSet

Material

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions