-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional validation type #38
Labels
enhancement
New feature or request
Comments
OldSneerJaw
added a commit
that referenced
this issue
Aug 27, 2018
The `conditional` validation type allows an item's value to conform to any one of several candidate validators. Each validator is accompanied by a condition that specifies whether to apply the validator to the item's value. If none of the conditions are satisfied, the value is rejected. This allows, for example, an array to contain a mix of data types or an object property to expect a different string format based on the state of other properties of the object.
dkichler
added a commit
that referenced
this issue
Aug 31, 2018
Issue #38: Implementation of conditional validation type
Addressed by #39 |
OldSneerJaw
added a commit
that referenced
this issue
Sep 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Request
Description
Currently each property or element can be defined with only one validation type (e.g.
string
,integer
,datetime
, etc.). However, there are cases where it may be beneficial to allow a value to be one of several types (e.g. a date as either an ISO 8601 date/time string or as a Unix timestamp) while still being able to set some constraints on them.Add a new validation type (e.g.
conditional
) that selects one of several different validators to apply to a property or element based on some condition (specified as a function).Examples
The text was updated successfully, but these errors were encountered: