@data-driven-forms/react-form-renderer/validation
(schema: Schema, options: Options) => object: Errors
Data Driven Forms provides an async function that validates values based on a provided schema. This feature can be useful to implement validation on backend endpoints with using the same schema as in frontend applications.
object
The same schema as for the form renderer. Validation supports all features except array validators that are being used by field arrays. This functionallity will be implemented in the future.
object
{values: AnyObject;componentMapper?: ComponentMapper;validatorMapper?: ValidatorMapper;actionMapper?: ActionMapper;schemaValidatorMapper?: SchemaValidatorMapper;omitWarnings?: boolean;}
object
Form values as sent from the renderer.
object
If not provided, all components are valid. Read more.
boolean
If this attribute set to true, warnings will be ignored and won't appear in the errors object.
object
A flat structure of errors.
{field: 'This field is required','field-with-warning': { type: 'warning', error: 'This is warning' },'nested.field': 'Some error message'}
If your form is changing according to form state or field states, be aware that this function will miss all meta information.