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
Person has List. Pet is an abstract class. Dog is a pet. Dog has a field called smelly. Cat is a pet. Cat has a field called douchey.
Rule for Person:
pets.douchey, Rules.required
Blows up because on fail-fast field validation it can't find the field douchey on abstract class Pet.
Expected behavior for fail-fast:
Check for all implementations of Pet, see if at least one of them has field douchey. If so, move along, else, throw error.
Expected behavior of rule validation:
When executing rule against path, make sure object has instance of field. If field not present (because no instanceof Cat), move along, else validate. Might need some configurability for this if people really did want to error on the field not being present, but I doubt it.
The text was updated successfully, but these errors were encountered:
"Check for all implementations of Pet, see if at least one of them has field douchey. If so, move along, else, throw error."
Do you mean all implementations of Pet with rules configured? What if you haven't configured rules for Cat because you just want to apply rules to Pet?
Person has List. Pet is an abstract class. Dog is a pet. Dog has a field called smelly. Cat is a pet. Cat has a field called douchey.
Rule for Person:
pets.douchey, Rules.required
Blows up because on fail-fast field validation it can't find the field douchey on abstract class Pet.
Expected behavior for fail-fast:
Check for all implementations of Pet, see if at least one of them has field douchey. If so, move along, else, throw error.
Expected behavior of rule validation:
When executing rule against path, make sure object has instance of field. If field not present (because no instanceof Cat), move along, else validate. Might need some configurability for this if people really did want to error on the field not being present, but I doubt it.
The text was updated successfully, but these errors were encountered: