Skip to content

Objects are wrapped in double mat-cards #2480

@DerMagereStudent

Description

@DerMagereStudent

Describe the bug

Inner/nested objects are rendered with 2 mat-cards wrapping them.

Expected behavior

Should only be wrapped in 1 card

Steps to reproduce the issue

Create a schema with an inner object and render it without a custom ui schema, i.e.:

{
  properties: {
    Inner: {
      $ref: '#/$defs/InnerModel',
    },
    // more properties
  },
  $defs: {
    InnerModel: {
      type: 'object',
      properties: {
        Name: {
          type: 'string',
        },
      },
      additionalProperties: false,
      required: ['Name'],
    },
  },
}

Stackblitz: https://stackblitz.com/edit/stackblitz-starters-kwtfxnuc?file=src%2Fmain.ts

Screenshots

No response

Which Version of JSON Forms are you using?

v3.6.0

Package

Angular Material Renderers

Additional context

Likely happens due to the fallback in findUiSchema:

return Generate.uiSchema(
newSchema,
'Group',
undefined,
this.rootSchema
);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions