Skip to content

Admin: Require one item in all required arrays - #698

Merged
lehni merged 1 commit into
mainfrom
fix/required-array-properties
Oct 25, 2026
Merged

lehni merged 1 commit into
mainfrom
fix/required-array-properties

Conversation

@lehni

@lehni lehni commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

required needs one item in all array values, as in lists and fields with multiple values: also in written array properties and in fields of custom types whose property is type: 'array'. minItems overrides it, e.g. minItems: 0 accepts none as an answer.

The rule lives in one place, PropertyNode.getValidationErrors(), for written and field-derived nodes alike. The field-side derivations (minItems: 1 in getDataKeywords(), the callback block in createFieldPropertyNode(), the minItems fallback in mergePropertyNodes()) are removed, so getFormProperties() no longer puts minItems: 1 into the properties it describes: the server keeps accepting [] for required, documented as an admin-only rule in tests/admin/properties.test.js.

@lehni
lehni enabled auto-merge (rebase) October 25, 2026 00:10
@lehni
lehni disabled auto-merge October 25, 2026 00:16
@lehni
lehni force-pushed the fix/required-array-properties branch from 94a1af3 to 8fa9314 Compare October 25, 2026 00:24
@lehni lehni changed the title Admin: Require one item in required array properties, like in fields Admin: Require one item in all required arrays Oct 25, 2026
@lehni
lehni enabled auto-merge (rebase) October 25, 2026 00:24
@lehni
lehni merged commit b81c5c8 into main Oct 25, 2026
8 checks passed
@lehni
lehni deleted the fix/required-array-properties branch October 25, 2026 00:32
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

Successfully merging this pull request may close these issues.

1 participant