validateJsonSchema function

List<String> validateJsonSchema(
  1. Object? value,
  2. Map<String, Object?> schema, {
  3. String path = 'args',
})

Validates value against schema, returning a list of violation messages (empty when valid). path names the root in messages (defaults to args).

Implementation

List<String> validateJsonSchema(
  Object? value,
  Map<String, Object?> schema, {
  String path = 'args',
}) {
  final errors = <String>[];
  _validate(value, schema, path, errors);
  return errors;
}