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

Allow minItems 0 to work for tabarray and array components #83

Closed
wants to merge 11 commits into from

Conversation

renanra
Copy link

@renanra renanra commented Sep 13, 2013

The change we made was allow minItems: 0 to work properly.

When using tabarray or array components, JsonForm will create a empty child if none is present on data(value).

Given the following schema:

{
  "schema": {
    "friends": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "Friend",
        "properties": {
          "nick": {
            "type": "string",
            "title": "Nickname",
            "required": true
          }
        }
      }
    }
  }
}

You can have no friends, but if you have one, they must have a nickname.
So, if one child is create if none is present, it kind of forces users to fill the friend's nickname.
Setting minItems: 0 solve this problem.

@albertoleal
Copy link

+1

@christianbundy
Copy link

Merged on my fork, thank you!

@stale
Copy link

stale bot commented Feb 28, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 28, 2020
@tchapi
Copy link
Member

tchapi commented Feb 28, 2020

This has been fixed by #264 I think

@tchapi tchapi closed this Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

6 participants