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

Optional arrays that have required elements are showing up as empty thus breaking validation #15

Open
ramesees opened this issue Mar 9, 2016 · 1 comment

Comments

@ramesees
Copy link

ramesees commented Mar 9, 2016

I have a JSON schema in which one of the top level properties is of type array, but this property is not a required property.

However the array definition is specified such that it must have at least one item inside (if it is specified on the top level property).

When rendering the form with the startEmpty property set to true, I get a property added into my produced JSON document. However my server side validation routine then rejects the document saying I need to provide at least one child item.

Is it possible to have a setting which doesnt create the array property on the resultant JSON document and upon clicking Add creates the property and initialises it to empty until I populate it ?

Thanks

@Anthropic
Copy link
Member

I don't believe so at the moment, we'd certainly accept a PR that could stop this from happening as it has been brought up in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants