feat(group-array): support default values#245
Merged
sandrina-p merged 2 commits intomainfrom Dec 2, 2025
Merged
Conversation
dragidavid
commented
Nov 26, 2025
sandrina-p
reviewed
Nov 27, 2025
749ca33 to
85038b3
Compare
sandrina-p
approved these changes
Dec 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Consuming applications rely on
field.defaultto apply default values to GROUP_ARRAY fields when they become visible conditionally. Two bugs prevented this:Missing defaults:
field.defaultwasundefinedfor GROUP_ARRAY fields after conditional schema processing, even when the JSON schema specified adefaultproperty.Incorrect inheritance: Inner fields were incorrectly inheriting the parent GROUP_ARRAY's default array instead of having
undefinedor their own defaults.Cause
During conditional schema merging, the
defaultproperty was lost when fields were hidden and then shown again. The code used the processed schema (which lost defaults) instead of preserving them fromoriginalSchema.When building inner fields, the code passed the GROUP_ARRAY schema as
originalSchemainstead of each inner field's own schema, causing the fallback logic to copy the parent's default array.Solution (I think)
Preserve defaults from
originalSchema: RestoredefaultfromoriginalSchemawhenfield.defaultisundefined, for both hidden and visible fields.Use correct schema for inner fields: Pass each inner field's original schema (
originalSchema.items.properties[key]) instead of the GROUP_ARRAY schema when building inner fields.json-schema to test: