You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -783,7 +783,14 @@ Adds an external validation rule where:
783
783
return a replacement value, `undefined` to indicate no change, or throw an error, where:
784
784
-`value` - a clone of the object containing the value being validated.
785
785
-`helpers` - an object with the following helpers:
786
+
-`schema` - the current schema.
787
+
-`linked` - if the schema is a link, the schema it links to.
788
+
-`state` - the current validation state.
786
789
-`prefs` - the current preferences.
790
+
-`original` - the original value passed into validation before any conversions.
791
+
-`error(code, [local])` - a method to generate error codes using a message code and optional local context.
792
+
-`message(messages, [local])` - a method to generate an error with an internal `'external'` error code and the provided messages object to use as override. Note that this is much slower than using the preferences `messages` option but is much simpler to write when performance is not important.
793
+
-`warn(code, [local])` - a method to add a warning using a message code and optional local context.
787
794
-`description` - optional string used to document the purpose of the method.
788
795
789
796
Note that external validation rules are only called after the all other validation rules for the
0 commit comments