function getSchema(keyRef) {
    var schemaObj = _getSchemaObj(keyRef);
    switch (typeof schemaObj) {
      case 'object': return schemaObj.validate || _compile(schemaObj);
      case 'string': return getSchema(schemaObj);
      case 'undefined': return _getSchemaFragment(keyRef);
    }
  }
Get compiled schema from the instance by `key` or `ref`.
@param  {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
@return {Function} schema validating function (with property `schema`).