-
Notifications
You must be signed in to change notification settings - Fork 379
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
feat: improve support for minItems
and maxItems
for array layout and control
#2387
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I agree that the current situation is not optimal. I would like to suggest to add a new prop We could think of a migration path with a major release or just keep the current prop naming, even if it's not ideal. @Typiqally can you add this |
I have added the The What do you think @sdirix? |
Yes, let's refactor our code so we use |
@sdirix, I have removed the props and deprecated the original |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ❤️
Added improved support for the
minItems
andmaxItems
properties, to allow for more fine-grained control and validation in ArrayControl and ArrayLayout applications. I have also added additional tests to cover these properties.While working on this, I realized that the current handling of array (or items) schemas is too restrictive for custom implementations. Specifically, the schema is being completely replaced by the items schema, which typically only includes a basic type description and hides important details like the
min
andmax
item properties from the original array schema.jsonforms/packages/core/src/mappers/renderer.ts
Lines 798 to 818 in fcef896
To address these limitations, I see two possible approaches:
parentSchema
property to preserve the original schema, keeping the existing behavior while easing the constraints. This might introduce some confusion around naming.schema
property and put the resolved schema in a newarraySchema
oritemsSchema
property. However, this would change the current behavior, requiring migration.I’d appreciate your thoughts on these options.