You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that while only requiredProperty is explicitly marked as required in the schema, optionalProperty is being populated because its child property, nestedRequiredProperty, is required and has a default value.
Looking at the existing test cases, such as this one:
Prerequisites
What theme are you using?
core
Version
5.22.3
Current Behavior
Under the setting
experimental_defaultFormStateBehavior: { emptyObjectFields: 'populateRequiredDefaults' },
the result is:
Expected Behavior
It seems that while only
requiredProperty
is explicitly marked as required in the schema,optionalProperty
is being populated because its child property,nestedRequiredProperty
, is required and has a default value.Looking at the existing test cases, such as this one:
react-jsonschema-form/packages/utils/test/schema/getDefaultFormStateTest.ts
Lines 2259 to 2286 in 1c443a6
It appears that this behavior works correctly for 2-level nested structures, but a bug seems to occur when the structure goes 3 levels deep.
Steps To Reproduce
No response
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: