Skip to content

Commit

Permalink
rjsf-team#818 document structure of errors object in transformErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
epicfaace committed Jan 20, 2019
1 parent 285d15b commit a937f50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,15 @@ render((
> Notes:
> - The `transformErrors()` function must return the list of errors. Modifying the list in place without returning it will result in an error.
Each element in the `errors` list passed to `transformErrors` has the following properties:
- `name`: name of the error, for example, "required" or "minLength"
- `message`: message, for example, "is a required property" or "should NOT be shorter than 3 characters"
- `params`: an object with the error params returned by ajv ([see doc](https://github.com/epoberezkin/ajv#error-parameters) for more info).
- `property`: a string in Javascript property accessor notation to the data path of the field with the error. For example, `.name` or `['first-name']`.
- `stack`: full error name, for example ".name is a required property".
- `schemaPath`: JSON pointer to the schema of the keyword that failed validation. For example, `#/fields/firstName/required`.
### Error List Display
To disable rendering of the error list at the top of the form, you can set the `showErrorList` prop to `false`. Doing so will still validate the form, but only the inline display will show.
Expand Down

0 comments on commit a937f50

Please sign in to comment.