json-schema-form/angular-schema-form-bootstrap

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

ramesees opened this issue · 1 comments

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

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.