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

JSON Schema - 'allOf' nested within the 'array' type field breaks the form #746

Closed
Mhal007 opened this issue Jun 16, 2020 · 2 comments
Closed
Assignees
Labels
Type: Bug Bug reports and their fixes

Comments

@Mhal007
Copy link
Member

Mhal007 commented Jun 16, 2020

When allOf is nested within the array type property, the form no longer works correctly. I'm not able to add new nested fields using the + button - they are not appearing.

Schema that I've used:

const schema = {
    title: 'Form',
    type: 'object',
    properties: {
      parentField: {
        items: {
          type: 'object',
          properties: {
            childField: {
              type: 'string',
            },
          },
          allOf: [{ required: ['childField'] }],
        },
        type: 'array',
      },
    },
  };

Result:
image

@Mhal007 Mhal007 changed the title allOf nested within the 'array' type field breaks the form JSONSchema - 'allOf' nested within the 'array' type field breaks the form Jun 16, 2020
@Mhal007 Mhal007 changed the title JSONSchema - 'allOf' nested within the 'array' type field breaks the form JSON Schema - 'allOf' nested within the 'array' type field breaks the form Jun 16, 2020
@radekmie radekmie added this to Needs triage in Open Source (migrated) Jun 17, 2020
@radekmie radekmie self-assigned this Jun 17, 2020
@radekmie radekmie added the Type: Bug Bug reports and their fixes label Jun 17, 2020
@radekmie radekmie moved this from Needs triage to To do in Open Source (migrated) Jun 17, 2020
@radekmie
Copy link
Contributor

radekmie commented Jun 17, 2020

Hi @Mhal007. It looks like the problem is in the merging part (v2, v3). Probably changing {} to _definition.properties ?? {} and [] to _definition.required ?? [] will do the job. Could you check it locally?

@Mhal007
Copy link
Member Author

Mhal007 commented Jun 17, 2020

Unfortunately, it ain't it. Still, the same issue occurs.

@radekmie radekmie moved this from To do to In progress in Open Source (migrated) Jun 17, 2020
Open Source (migrated) automation moved this from In progress to Closed Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug reports and their fixes
Projects
Archived in project
Development

No branches or pull requests

2 participants