Skip to content

AnyOf subschemas defined in refs don't get correct labels from createCombinatorRenderInfos #2164

@DrewHoo

Description

@DrewHoo

Describe the bug

Consider this schema:

{
  type: 'object',
  properties: {
    widget: {
      anyOf: [
        {
          $ref: '#/definitions/Dua',
        },
        {
          $ref: '#/definitions/Lipa',
        },
      ],
    },
  },
  definitions: {
    Dua: {
      title: 'Dua',
      type: 'object',
      properties: { name: { type: 'string' } },
    },
    Lipa: {
      title: 'Lipa',
      type: 'object',
      properties: { name: { type: 'string' } },
    },
  },
};

When calling createCombinatorRenderInfos, the title of the subschemas is not reflected in the label for individual renderinfos.

Expected behavior

The label for individual renderinfos is informed by the title of the subschema.

Steps to reproduce the issue

I've got a test case in a PR I'm about to open, which fails without the change I'm introducing.

Screenshots

No response

In which browser are you experiencing the issue?

Node

Which Version of JSON Forms are you using?

v3.1.0

Framework

Core

RendererSet

Material, Vanilla, Other (please specify in the Additional context field)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions