Nested schema objects with required properties in dependencies validate incorrectly
I'm providing a sample JSFiddle .
Select Address in the sections drop down
Click Submit
The Form validates correctly and renders errors on Street and Street Number
The Form validates with no errors and invokes the onSubmit prop
The error seems to be with ajv.js Ajv will not validate against nested schemas in dependencies unless the formData for the schema has been touched.
Ie setting formData.address = {} will validate correctly

It may be worth opening an issue in AJV
I can repro this with a much simpler schema. See this JSFiddle.
Note that this capability is specifically called out as being supported, here.
The schema for reference here:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {"enabled": {"type": "boolean", "default": false}},
"required": ["enabled"],
"dependencies": {
"enabled": {
"oneOf": [
{
"properties": {"enabled": {"type": "boolean", "const": false}},
"additionalProperties": false
},
{
"properties": {
"enabled": {"type": "boolean", "const": true},
"dependentBoolean": {
"type": "boolean",
"default": true
}
},
"required": [
"enabled",
"dependentBoolean"
],
"additionalProperties": false
}
]
}
}
}
rjsf fails submission of this valid data:
{
"enabled": false
}
rjsf allows submission of this invalid data:
{
"enabled": true
}
ajv command line correctly rejects this invalid data:
[ { keyword: 'const',
dataPath: '.enabled',
schemaPath: '#/dependencies/enabled/oneOf/0/properties/enabled/const',
params: { allowedValue: false },
message: 'should be equal to constant' },
{ keyword: 'required',
dataPath: '',
schemaPath: '#/dependencies/enabled/oneOf/1/required',
params: { missingProperty: 'dependentBoolean' },
message: 'should have required property \'dependentBoolean\'' },
{ keyword: 'oneOf',
dataPath: '',
schemaPath: '#/dependencies/enabled/oneOf',
params: { passingSchemas: null },
message: 'should match exactly one schema in oneOf' } ]
Furthermore, the default value for dependentBoolean does not get filled in the formData when enabled becomes true, as expected.
Most helpful comment
I can repro this with a much simpler schema. See this JSFiddle.
Note that this capability is specifically called out as being supported, here.
The schema for reference here:
rjsf fails submission of this valid data:
rjsf allows submission of this invalid data:
ajvcommand line correctly rejects this invalid data:Furthermore, the default value for
dependentBooleandoes not get filled in the formData whenenabledbecomes true, as expected.