src/validate.js
function transformAjvErrors(errors = []) {
  if (errors === null) {
    return [];
  }

  return errors.map(e => {
    const { dataPath, keyword, message, params, schemaPath } = e;
    let property = `${dataPath}`;

    // put data in expected format
    return {
      name: keyword,
      property,
      message,
      params, // specific to ajv
      stack: `${property} ${message}`.trim(),
      schemaPath,
    };
  });
}
function transformAjvErrors(errors = []) {
  if (errors === null) {
    return [];
  }

  return errors.map(e => {
    const { dataPath, keyword, message, params, schemaPath } = e;
    let property = `${dataPath}`;

    // put data in expected format
    return {
      name: keyword,
      property,
      message,
      params, // specific to ajv
      stack: `${property} ${message}`.trim(),
      schemaPath,
    };
  });
}
function transformAjvErrors ( errors = [ ] ) { if ( errors === null ) { return [ ] ; } return errors . map ( e => { const { dataPath , keyword , message , params , schemaPath } = e ; let property = ` ${ dataPath } ` ; // put data in expected format return { name : keyword , property , message , params , // specific to ajv stack : ` ${ property } ${ message } ` . trim ( ) , schemaPath , } ; } ) ; }
Transforming the error output from ajv to format used by jsonschema.
At some point, components should be updated to support ajv.
Transforming the error output from ajv to format used by jsonschema . At some point components should be updated to support ajv .