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
With v4, the schema used to validate nested properties inside of dependencies (e.g. oneOf) where the fields had no interaction. We have recently used v5 and in our example we have address which has several required properties such as "Town", on submit, "Town" would get validated, however in newer version (v.5) only address as a whole is validated, that is until one of the properties are set.
Expected Behavior
I went through the documentation and can't find any material on this. I have inspected v4 and in the schema example, address would be sent to {} where as in v5 address is not set to anything
* fix: Fix 3391 by restoring creation of empty root objects
Fixes#3391 by adding the `excludeObjectChildren` third parameter to the main `getDefaultFormState()`
* - Fixes#3393 by properly deduplicating when `schema.default` exists in `schema.examples`
* - Fix security warning to add newer versions and to unsupport old ones
Prerequisites
What theme are you using?
core
Version
5.0.0-beta.15
Current Behavior
With v4, the schema used to validate nested properties inside of dependencies (e.g. oneOf) where the fields had no interaction. We have recently used v5 and in our example we have address which has several required properties such as "Town", on submit, "Town" would get validated, however in newer version (v.5) only address as a whole is validated, that is until one of the properties are set.
Expected Behavior
I went through the documentation and can't find any material on this. I have inspected v4 and in the schema example, address would be sent to {} where as in v5 address is not set to anything
Steps To Reproduce
Using rjfs playground
Setting schema to:
{ "type":"object", "required":[ "haveAddress" ], "properties":{ "haveAddress":{ "type":"boolean", "title":"Do you have an address?" } }, "dependencies":{ "haveAddress":{ "oneOf":[ { "required":[ "haveAddress", "address" ], "properties":{ "address":{ "type":"object", "title":"What is your home address", "required":[ "addressOne", "town", "postcode" ], "properties":{ "town":{ "type":"string", "title":"Town / City" }, "country":{ "type":"string", "title":"Country" }, "postcode":{ "type":"string", "title":"Postcode" }, "addressOne":{ "type":"string", "title":"Address 1" }, "addressTwo":{ "type":"string", "title":"Address 2" } } }, "haveAddress":{ "enum":[ true ], "type":"boolean" } } } ] } } }
Using similar schema, which has default value set for "Town", will validate nested properties, somewhat as you would expect it to happen by default.
{ "type":"object", "required":[ "haveAddress" ], "properties":{ "haveAddress":{ "type":"boolean", "title":"Do you have an address?" } }, "dependencies":{ "haveAddress":{ "oneOf":[ { "required":[ "haveAddress", "address" ], "properties":{ "address":{ "type":"object", "title":"What is your home address", "required":[ "addressOne", "town", "postcode" ], "properties":{ "town":{ "type":"string", "title":"Town / City", "default":null }, "country":{ "type":"string", "title":"Country" }, "postcode":{ "type":"string", "title":"Postcode" }, "addressOne":{ "type":"string", "title":"Address 1" }, "addressTwo":{ "type":"string", "title":"Address 2" } } }, "haveAddress":{ "enum":[ true ], "type":"boolean" } } } ] } } }
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: