Skip to content

Need support for Polymorphism #70

@twicksell

Description

@twicksell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions