Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DrewHoo opened this issue Jul 18, 2023 · 0 comments · Fixed by #2165
Closed
Labels
Milestone

Comments

@DrewHoo
Copy link
Contributor

DrewHoo commented Jul 18, 2023

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

sdirix pushed a commit that referenced this issue Aug 8, 2023
'title' can be defined in both the resolving subschema and the resolved to subschema.
This fix enhances JSON Forms to take both of these cases into account when resolving
subschemas in combinators. Intermediate titles will still be ignored.

Fixes #2164
@sdirix sdirix added this to the 3.2 milestone Aug 8, 2023
@sdirix sdirix added the core label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants