anyOf
form validation error messages confusing when anyOf
items contain properties found in other items
#4167
Labels
Prerequisites
What theme are you using?
core
Version
5.18.2
Current Behavior
I am seeing confusing error messages when interacting with a form that uses
anyOf
where properties in ananyOf
item are also found in otheranyOf
items.In this schema for example:
because
favouriteAnimal
is a property of all threeanyOf
items and required in 2 of them, when I choseOption 1
and submit the form without providing a value forfavouriteAnimal
then I will see twomust have required property 'favouriteAnimal'
error messages.You can also see that
favouriteColor
is showing a required error message even though it is optional forOption 1
. This is because it is required inOption 2
.You can also see that
favouritePerson
is showing a required error message even though it is not a property ofOption 1
. This is because it is required inOption 3
.Expected Behavior
The form should only show error messages relevant to the current
anyOf
option selected.Steps To Reproduce
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: