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

Respect "default" values when creating new elements in an array #2195

Closed
sdirix opened this issue Oct 19, 2023 · 0 comments · Fixed by #2206
Closed

Respect "default" values when creating new elements in an array #2195

sdirix opened this issue Oct 19, 2023 · 0 comments · Fixed by #2206
Assignees
Labels
Milestone

Comments

@sdirix
Copy link
Member

sdirix commented Oct 19, 2023

Is your feature request related to a problem? Please describe.

JSON Schema specifies default property. As there is no specific behavior defined in the specification regarding this attribute, we usually ignore it.

Usually we ignore this property in JSON Forms and let for example AJV handle it. However in the case of adding new elements in arrays, it would make sense for JSON Forms to respect the default attribute and initialize the new element in this way. This feature could be made optional either via UI Schema options or the config.

Describe the solution you'd like

Support the default attribute in JSON Schema when creating new array elements.

Describe alternatives you've considered

Not supporting this feature or turn it off by default.

Framework

Core, React, Angular, Vue 3

RendererSet

No response

Additional context

No response

AlexandraBuzila added a commit to AlexandraBuzila/jsonforms that referenced this issue Nov 9, 2023
AlexandraBuzila added a commit to AlexandraBuzila/jsonforms that referenced this issue Nov 9, 2023
AlexandraBuzila added a commit to AlexandraBuzila/jsonforms that referenced this issue Nov 9, 2023
Initialize new array elements with their default values.
Fixes default value returned for string schemas with a date format.

Fixes eclipsesource#2195
AlexandraBuzila added a commit to AlexandraBuzila/jsonforms that referenced this issue Nov 9, 2023
Initialize new array elements with their default values.
Fixes default value returned for string schemas with a date format.

Fixes eclipsesource#2195

Contributed on behalf of ST Microelectronics
AlexandraBuzila added a commit to AlexandraBuzila/jsonforms that referenced this issue Nov 10, 2023
Initialize new array elements with their default values.
Fixes default value returned for string schemas with a date format.

Fixes eclipsesource#2195

Contributed on behalf of STMicroelectronics

Signed-off-by: Alexandra Buzila <[email protected]>
AlexandraBuzila added a commit to AlexandraBuzila/jsonforms that referenced this issue Nov 10, 2023
Initialize new array elements with their default values.
Fixes default value returned for string schemas with a date format.

Fixes eclipsesource#2195

Contributed on behalf of STMicroelectronics

Signed-off-by: Alexandra Buzila <[email protected]>
sdirix pushed a commit to AlexandraBuzila/jsonforms that referenced this issue Nov 13, 2023
Initialize new array elements with their default values.
Fixes default value returned for string schemas with a date format.

Fixes eclipsesource#2195

Contributed on behalf of STMicroelectronics

Signed-off-by: Alexandra Buzila <[email protected]>
sdirix pushed a commit that referenced this issue Nov 13, 2023
Initialize new array elements with their default values.
Fixes default value returned for string schemas with a date format.

Fixes #2195

Contributed on behalf of STMicroelectronics

Signed-off-by: Alexandra Buzila <[email protected]>
@sdirix sdirix added this to the 3.2 milestone Jan 30, 2024
@sdirix sdirix added the core label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants