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
Validation passes and no default object is created
Expected Behavior
Validation should error
In version 4, the object added a default {} to the form data which allowed ajv to trigger the validation. Now, the empty object is not being added by default.
Steps To Reproduce
Have a schema with an object and a property inside that object is required but the object itself is not required
Disable HTML 5 validation
Form data is empty {} or undefined
Save the form without adding any data
Observe form passed validation and no errors were displayed
I've tested with both ajv6 and ajv8 with the same result
Tried to update the emptyobjectfields property but this didnt fix it. This setting says that it should populate defaults for non-empty objects (which worked in v4 as the legacy behavior) but it doesnt anymore
The text was updated successfully, but these errors were encountered:
@kyliem29 Hi, the behavior you were expecting that was present in v4 was actually a bug that many others had reported. To get your schema to work, you will need to require the testobject property.
Prerequisites
What theme are you using?
core
Version
5.13.2 (latest on playground)
Current Behavior
Validation passes and no default object is created
Expected Behavior
Validation should error
In version 4, the object added a default
{}
to the form data which allowed ajv to trigger the validation. Now, the empty object is not being added by default.Steps To Reproduce
{}
or undefinedEnvironment
Anything else?
Playground link with example
Example schema
I've tested with both ajv6 and ajv8 with the same result
Tried to update the emptyobjectfields property but this didnt fix it. This setting says that it should populate defaults for non-empty objects (which worked in v4 as the legacy behavior) but it doesnt anymore
The text was updated successfully, but these errors were encountered: