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

Inconsistent rendering of schemas describing the same data shape #604

Closed
llamamoray opened this issue Jun 7, 2017 · 5 comments
Closed

Comments

@llamamoray
Copy link
Collaborator

Description

I've got two schemas that produce the same resulting shape of data from the form:

    const schema1 = {
      type: 'object',
      properties: {
        multipleChoicesList: {
          uniqueItems: true,
          items: {
            enum: ['Entity A', 'Entity B', 'Entity C', 'Entity D'],
            type: 'string',
          },
          type: 'array',
          title: 'A multiple choices list',
        },
      },
    };

    const schema2 = {
      definitions: {
        entityList: {
          enum: ['Entity A', 'Entity B', 'Entity C'],
          type: 'string',
        },
      },
      type: 'object',
      properties: {
        'Entity List': {
          uniqueItems: true,
          items: { $ref: '#/definitions/entityList' },
          type: 'array',
        },
      },
    };

They produce two different forms:

schema1:
image

schema2:
image

Is this considered a bug in the library? It means that adding a uiSchema 'ui:widget': 'checkboxes' does not work with schema2.

Steps to Reproduce

Apply schemas above to playground.

Expected behavior

Two schemas describing the same shape to produce the same form elements.

Version

0.48.0

@glasserc
Copy link
Contributor

glasserc commented Jun 7, 2017

Yes, that looks like a bug. Using $ref shouldn't change the schema.

@llamamoray
Copy link
Collaborator Author

@glasserc Do you know where in the code the problem is?

@glasserc
Copy link
Contributor

glasserc commented Jun 8, 2017

No, not off the top of my head, sorry.

@llamamoray
Copy link
Collaborator Author

@glasserc This seems to be fixed in the current live playground. Do you know when the next release will be?

@glasserc
Copy link
Contributor

glasserc commented Sep 6, 2017

Yeah, this got fixed by #581. I just released v0.50.0 which should contain the fix.

@glasserc glasserc closed this as completed Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants