Skip to content

Suggestion for conditional validation #134

Open
@janhaesen

Description

@janhaesen

I'm wondering how one would suggest altering the code concerning validations in such a way that a conditional validator can be incorporated that is dependent on other values.

For example given an object that has a start and end date parameter. I'd like to validate that the end date is higher or equal to the start date.

Currently all validation is on a individual field basis. Which works well for 95% of the use cases. I was personally thinking of adjusting the ValidationHandler

to create perhaps a wrapper around it that will be able to validate the properties once all others are done. Considering the ValidationHandler is recursive this is in theory already kind of the case. I've yet to found a way that I see fitting well.

What suggestions would you have?
Would you feel this being a worthy contribution to the library?

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