Skip to content

Commit

Permalink
note on JTD error objects
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Feb 10, 2021
1 parent 9e5f247 commit 078d6a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ interface JTDErrorObject {

This error format is used when using JTD schemas. To simplify usage, you may still generate Ajv error objects using `ajvErrors` option. You can also add a human-readable error message to error objects using option `messages`.

**Please note**: Ajv is not fully consistent with JTD regarding the error objects in some scenarios - it will be consistent by the time Ajv version 8 is released. Therefore it is not recommended yet to use error objects for any advanced application logic.

### Error parameters

Properties of `params` object in errors depend on the keyword that failed validation.
Expand Down

0 comments on commit 078d6a8

Please sign in to comment.