lib/ajv.js
function getSchema(keyRef) {
  var schemaObj = _getSchemaObj(this, keyRef);
  switch (typeof schemaObj) {
    case 'object': return schemaObj.validate || this._compile(schemaObj);
    case 'string': return this.getSchema(schemaObj);
    case 'undefined': return _getSchemaFragment(this, keyRef);
  }
}
function getSchema(keyRef) {
  var schemaObj = _getSchemaObj(this, keyRef);
  switch (typeof schemaObj) {
    case 'object': return schemaObj.validate || this._compile(schemaObj);
    case 'string': return this.getSchema(schemaObj);
    case 'undefined': return _getSchemaFragment(this, keyRef);
  }
}
function getSchema ( keyRef ) { var schemaObj = _getSchemaObj ( this , keyRef ) ; switch ( typeof schemaObj ) { case 'object' : return schemaObj . validate || this . _compile ( schemaObj ) ; case 'string' : return this . getSchema ( schemaObj ) ; case 'undefined' : return _getSchemaFragment ( this , keyRef ) ; } }
Get compiled schema from the instance by `key` or `ref`.
@this   Ajv
@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`).
Get compiled schema from the instance by key or ref .