Skip to content
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

Nested validation of all elements of Array #4

Closed
queimadus opened this issue Mar 17, 2016 · 2 comments
Closed

Nested validation of all elements of Array #4

queimadus opened this issue Mar 17, 2016 · 2 comments

Comments

@queimadus
Copy link
Contributor

var array = ["google.com", "wrong", "youtube.com"]

There is a way to validate specific fields of an array:

var descriptor = {
  roles: {
    type: "array", required: true,
     fields: {
       0: {type: "url"},
       1: {type: "url"},
       2: {type: "url"}
     }
  }
}

Is there a way to validate all fields of an array?

var descriptor = {
  roles: {
    type: "array", required: true,
    allFields: {type: "url"}
  }
}
@yiminghe
Copy link
Owner

welcome pr.

@yiminghe
Copy link
Owner

1.6.0

var descriptor = {
  roles: {
    type: "array", required: true,
    defaultField: {type: "url"}
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants