code: function Ajv(opts) {
    if (!(this instanceof Ajv)) return new Ajv(opts);
    opts = this._opts = util.copy(opts) || {};
    setLogger(this);
    this._schemas = {};
    this._refs = {};
    this._fragments = {};
    this._formats = formats(opts.format);
  
    this._cache = opts.cache || new Cache;
    this._loadingSchemas = {};
    this._compilations = [];
    this.RULES = rules();
    this._getId = chooseGetId(opts);
  
    opts.loopRequired = opts.loopRequired || Infinity;
    if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
    if (opts.serialize === undefined) opts.serialize = stableStringify;
    this._metaOpts = getMetaSchemaOptions(this);
  
    if (opts.formats) addInitialFormats(this);
    addDefaultMetaSchema(this);
    if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
    if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});
    addInitialSchemas(this);
  }
docs: Creates validator instance.
  Usage: `Ajv(opts)`
  @param {Object} opts optional options
  @return {Object} ajv instance