Skip to content

Commit

Permalink
docs: document array validation behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
aldeed committed Feb 26, 2024
1 parent 983ca42 commit 555f790
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ There are also reasons not to choose this package. Because of all it does, this
- [Unnamed Validation Contexts](#unnamed-validation-contexts)
- [Validating an Object](#validating-an-object)
- [Validating Only Some Keys in an Object](#validating-only-some-keys-in-an-object)
- [Validating Multiple Objects in an Array](#validating-multiple-objects-in-an-array)
- [Validation Options](#validation-options)
- [Validating and Throwing ValidationErrors](#validating-and-throwing-validationerrors)
- [Customize the Error That is Thrown](#customize-the-error-that-is-thrown)
Expand Down Expand Up @@ -907,6 +908,10 @@ You may have the need to (re)validate certain keys while leaving any errors for

This method returns `true` only if all the specified schema keys and their descendent keys are valid according to the schema. Otherwise it returns `false`.

### Validating Multiple Objects in an Array

As a convenience, you may pass an array of objects to the `validate` function and SimpleSchema will validate them all. The first error found will cause the whole array to be considered invalid. The array itself is not validated, so validation will pass if it is empty and field names will not begin with `$`.

### Validation Options

`validate()` accepts the following options:
Expand Down

0 comments on commit 555f790

Please sign in to comment.