Fix behaviour of arrays with minItems and default #655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When providing both
default
(as a list) andminItems
to a field of typearray
the defaults are treated as a single value that ends up in each field.
Relates to ticket
#631
Expected behavior
defaults should be treated as a list and be given one entry each, i.e.:
When minItems > default.length provide empty or item-level default fields after the fields with the default values.
When minItems <= default.length provide one field per value in default list.
Actual behavior
The default items gets mashed together into each field
Checklist
npm run cs-format
on my branch to conform my code to prettier coding style