'use strict';
var formats = require('ajv/lib/compile/formats')();
var equal = require('ajv/lib/compile/equal');
var validate = (function() {
  var refVal = [];
  return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
    'use strict'; /*# sourceURL=https://formats.openag.io/oada/bookmarks/v1.schema.json */
    var vErrors = null;
    var errors = 0;
    if (rootData === undefined) rootData = data;
    if ((data && typeof data === "object" && !Array.isArray(data))) {
      if (true) {
        var errs__0 = errors;
        var valid1 = true;
        var data1 = data.trellisfw;
        if (data1 === undefined) {
          valid1 = true;
        } else {
          var errs_1 = errors;
          if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
            if (true) {
              var errs__1 = errors;
              var valid2 = true;
              if (data1._id === undefined) {
                valid2 = false;
                validate.errors = [{
                  keyword: 'required',
                  dataPath: (dataPath || '') + '.trellisfw',
                  schemaPath: '#/properties/trellisfw/required',
                  params: {
                    missingProperty: '_id'
                  },
                  message: 'should have required property \'_id\''
                }];
                return false;
              } else {
                var errs_2 = errors;
                if (typeof data1._id !== "string") {
                  validate.errors = [{
                    keyword: 'type',
                    dataPath: (dataPath || '') + '.trellisfw._id',
                    schemaPath: '#/properties/trellisfw/properties/_id/type',
                    params: {
                      type: 'string'
                    },
                    message: 'should be string'
                  }];
                  return false;
                }
                var valid2 = errors === errs_2;
              }
              if (valid2) {
                var data2 = data1._rev;
                if (data2 === undefined) {
                  valid2 = false;
                  validate.errors = [{
                    keyword: 'required',
                    dataPath: (dataPath || '') + '.trellisfw',
                    schemaPath: '#/properties/trellisfw/required',
                    params: {
                      missingProperty: '_rev'
                    },
                    message: 'should have required property \'_rev\''
                  }];
                  return false;
                } else {
                  var errs_2 = errors;
                  if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                    validate.errors = [{
                      keyword: 'type',
                      dataPath: (dataPath || '') + '.trellisfw._rev',
                      schemaPath: '#/properties/trellisfw/properties/_rev/type',
                      params: {
                        type: 'integer'
                      },
                      message: 'should be integer'
                    }];
                    return false;
                  }
                  var valid2 = errors === errs_2;
                }
                if (valid2) {}
              }
              if (errs__1 == errors) {}
            }
          } else {
            validate.errors = [{
              keyword: 'type',
              dataPath: (dataPath || '') + '.trellisfw',
              schemaPath: '#/properties/trellisfw/type',
              params: {
                type: 'object'
              },
              message: 'should be object'
            }];
            return false;
          }
          if (errors === errs_1) {}
          var valid1 = errors === errs_1;
        }
        if (valid1) {
          var data1 = data.planting;
          if (data1 === undefined) {
            valid1 = true;
          } else {
            var errs_1 = errors;
            if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
              if (true) {
                var errs__1 = errors;
                var valid2 = true;
                if (data1._id === undefined) {
                  valid2 = false;
                  validate.errors = [{
                    keyword: 'required',
                    dataPath: (dataPath || '') + '.planting',
                    schemaPath: '#/properties/planting/required',
                    params: {
                      missingProperty: '_id'
                    },
                    message: 'should have required property \'_id\''
                  }];
                  return false;
                } else {
                  var errs_2 = errors;
                  if (typeof data1._id !== "string") {
                    validate.errors = [{
                      keyword: 'type',
                      dataPath: (dataPath || '') + '.planting._id',
                      schemaPath: '#/properties/planting/properties/_id/type',
                      params: {
                        type: 'string'
                      },
                      message: 'should be string'
                    }];
                    return false;
                  }
                  var valid2 = errors === errs_2;
                }
                if (valid2) {
                  var data2 = data1._rev;
                  if (data2 === undefined) {
                    valid2 = false;
                    validate.errors = [{
                      keyword: 'required',
                      dataPath: (dataPath || '') + '.planting',
                      schemaPath: '#/properties/planting/required',
                      params: {
                        missingProperty: '_rev'
                      },
                      message: 'should have required property \'_rev\''
                    }];
                    return false;
                  } else {
                    var errs_2 = errors;
                    if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                      validate.errors = [{
                        keyword: 'type',
                        dataPath: (dataPath || '') + '.planting._rev',
                        schemaPath: '#/properties/planting/properties/_rev/type',
                        params: {
                          type: 'integer'
                        },
                        message: 'should be integer'
                      }];
                      return false;
                    }
                    var valid2 = errors === errs_2;
                  }
                  if (valid2) {}
                }
                if (errs__1 == errors) {}
              }
            } else {
              validate.errors = [{
                keyword: 'type',
                dataPath: (dataPath || '') + '.planting',
                schemaPath: '#/properties/planting/type',
                params: {
                  type: 'object'
                },
                message: 'should be object'
              }];
              return false;
            }
            if (errors === errs_1) {}
            var valid1 = errors === errs_1;
          }
          if (valid1) {
            var data1 = data.harvest;
            if (data1 === undefined) {
              valid1 = true;
            } else {
              var errs_1 = errors;
              if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                if (true) {
                  var errs__1 = errors;
                  var valid2 = true;
                  if (data1._id === undefined) {
                    valid2 = false;
                    validate.errors = [{
                      keyword: 'required',
                      dataPath: (dataPath || '') + '.harvest',
                      schemaPath: '#/properties/harvest/required',
                      params: {
                        missingProperty: '_id'
                      },
                      message: 'should have required property \'_id\''
                    }];
                    return false;
                  } else {
                    var errs_2 = errors;
                    if (typeof data1._id !== "string") {
                      validate.errors = [{
                        keyword: 'type',
                        dataPath: (dataPath || '') + '.harvest._id',
                        schemaPath: '#/properties/harvest/properties/_id/type',
                        params: {
                          type: 'string'
                        },
                        message: 'should be string'
                      }];
                      return false;
                    }
                    var valid2 = errors === errs_2;
                  }
                  if (valid2) {
                    var data2 = data1._rev;
                    if (data2 === undefined) {
                      valid2 = false;
                      validate.errors = [{
                        keyword: 'required',
                        dataPath: (dataPath || '') + '.harvest',
                        schemaPath: '#/properties/harvest/required',
                        params: {
                          missingProperty: '_rev'
                        },
                        message: 'should have required property \'_rev\''
                      }];
                      return false;
                    } else {
                      var errs_2 = errors;
                      if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                        validate.errors = [{
                          keyword: 'type',
                          dataPath: (dataPath || '') + '.harvest._rev',
                          schemaPath: '#/properties/harvest/properties/_rev/type',
                          params: {
                            type: 'integer'
                          },
                          message: 'should be integer'
                        }];
                        return false;
                      }
                      var valid2 = errors === errs_2;
                    }
                    if (valid2) {}
                  }
                  if (errs__1 == errors) {}
                }
              } else {
                validate.errors = [{
                  keyword: 'type',
                  dataPath: (dataPath || '') + '.harvest',
                  schemaPath: '#/properties/harvest/type',
                  params: {
                    type: 'object'
                  },
                  message: 'should be object'
                }];
                return false;
              }
              if (errors === errs_1) {}
              var valid1 = errors === errs_1;
            }
            if (valid1) {
              var data1 = data.machines;
              if (data1 === undefined) {
                valid1 = true;
              } else {
                var errs_1 = errors;
                if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                  if (true) {
                    var errs__1 = errors;
                    var valid2 = true;
                    if (data1._id === undefined) {
                      valid2 = false;
                      validate.errors = [{
                        keyword: 'required',
                        dataPath: (dataPath || '') + '.machines',
                        schemaPath: '#/properties/machines/required',
                        params: {
                          missingProperty: '_id'
                        },
                        message: 'should have required property \'_id\''
                      }];
                      return false;
                    } else {
                      var errs_2 = errors;
                      if (typeof data1._id !== "string") {
                        validate.errors = [{
                          keyword: 'type',
                          dataPath: (dataPath || '') + '.machines._id',
                          schemaPath: '#/properties/machines/properties/_id/type',
                          params: {
                            type: 'string'
                          },
                          message: 'should be string'
                        }];
                        return false;
                      }
                      var valid2 = errors === errs_2;
                    }
                    if (valid2) {
                      var data2 = data1._rev;
                      if (data2 === undefined) {
                        valid2 = false;
                        validate.errors = [{
                          keyword: 'required',
                          dataPath: (dataPath || '') + '.machines',
                          schemaPath: '#/properties/machines/required',
                          params: {
                            missingProperty: '_rev'
                          },
                          message: 'should have required property \'_rev\''
                        }];
                        return false;
                      } else {
                        var errs_2 = errors;
                        if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                          validate.errors = [{
                            keyword: 'type',
                            dataPath: (dataPath || '') + '.machines._rev',
                            schemaPath: '#/properties/machines/properties/_rev/type',
                            params: {
                              type: 'integer'
                            },
                            message: 'should be integer'
                          }];
                          return false;
                        }
                        var valid2 = errors === errs_2;
                      }
                      if (valid2) {}
                    }
                    if (errs__1 == errors) {}
                  }
                } else {
                  validate.errors = [{
                    keyword: 'type',
                    dataPath: (dataPath || '') + '.machines',
                    schemaPath: '#/properties/machines/type',
                    params: {
                      type: 'object'
                    },
                    message: 'should be object'
                  }];
                  return false;
                }
                if (errors === errs_1) {}
                var valid1 = errors === errs_1;
              }
              if (valid1) {
                var data1 = data.irrigation;
                if (data1 === undefined) {
                  valid1 = true;
                } else {
                  var errs_1 = errors;
                  if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                    if (true) {
                      var errs__1 = errors;
                      var valid2 = true;
                      if (data1._id === undefined) {
                        valid2 = false;
                        validate.errors = [{
                          keyword: 'required',
                          dataPath: (dataPath || '') + '.irrigation',
                          schemaPath: '#/properties/irrigation/required',
                          params: {
                            missingProperty: '_id'
                          },
                          message: 'should have required property \'_id\''
                        }];
                        return false;
                      } else {
                        var errs_2 = errors;
                        if (typeof data1._id !== "string") {
                          validate.errors = [{
                            keyword: 'type',
                            dataPath: (dataPath || '') + '.irrigation._id',
                            schemaPath: '#/properties/irrigation/properties/_id/type',
                            params: {
                              type: 'string'
                            },
                            message: 'should be string'
                          }];
                          return false;
                        }
                        var valid2 = errors === errs_2;
                      }
                      if (valid2) {
                        var data2 = data1._rev;
                        if (data2 === undefined) {
                          valid2 = false;
                          validate.errors = [{
                            keyword: 'required',
                            dataPath: (dataPath || '') + '.irrigation',
                            schemaPath: '#/properties/irrigation/required',
                            params: {
                              missingProperty: '_rev'
                            },
                            message: 'should have required property \'_rev\''
                          }];
                          return false;
                        } else {
                          var errs_2 = errors;
                          if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                            validate.errors = [{
                              keyword: 'type',
                              dataPath: (dataPath || '') + '.irrigation._rev',
                              schemaPath: '#/properties/irrigation/properties/_rev/type',
                              params: {
                                type: 'integer'
                              },
                              message: 'should be integer'
                            }];
                            return false;
                          }
                          var valid2 = errors === errs_2;
                        }
                        if (valid2) {}
                      }
                      if (errs__1 == errors) {}
                    }
                  } else {
                    validate.errors = [{
                      keyword: 'type',
                      dataPath: (dataPath || '') + '.irrigation',
                      schemaPath: '#/properties/irrigation/type',
                      params: {
                        type: 'object'
                      },
                      message: 'should be object'
                    }];
                    return false;
                  }
                  if (errors === errs_1) {}
                  var valid1 = errors === errs_1;
                }
                if (valid1) {
                  var data1 = data.sensors;
                  if (data1 === undefined) {
                    valid1 = true;
                  } else {
                    var errs_1 = errors;
                    if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                      if (true) {
                        var errs__1 = errors;
                        var valid2 = true;
                        if (data1._id === undefined) {
                          valid2 = false;
                          validate.errors = [{
                            keyword: 'required',
                            dataPath: (dataPath || '') + '.sensors',
                            schemaPath: '#/properties/sensors/required',
                            params: {
                              missingProperty: '_id'
                            },
                            message: 'should have required property \'_id\''
                          }];
                          return false;
                        } else {
                          var errs_2 = errors;
                          if (typeof data1._id !== "string") {
                            validate.errors = [{
                              keyword: 'type',
                              dataPath: (dataPath || '') + '.sensors._id',
                              schemaPath: '#/properties/sensors/properties/_id/type',
                              params: {
                                type: 'string'
                              },
                              message: 'should be string'
                            }];
                            return false;
                          }
                          var valid2 = errors === errs_2;
                        }
                        if (valid2) {
                          var data2 = data1._rev;
                          if (data2 === undefined) {
                            valid2 = false;
                            validate.errors = [{
                              keyword: 'required',
                              dataPath: (dataPath || '') + '.sensors',
                              schemaPath: '#/properties/sensors/required',
                              params: {
                                missingProperty: '_rev'
                              },
                              message: 'should have required property \'_rev\''
                            }];
                            return false;
                          } else {
                            var errs_2 = errors;
                            if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                              validate.errors = [{
                                keyword: 'type',
                                dataPath: (dataPath || '') + '.sensors._rev',
                                schemaPath: '#/properties/sensors/properties/_rev/type',
                                params: {
                                  type: 'integer'
                                },
                                message: 'should be integer'
                              }];
                              return false;
                            }
                            var valid2 = errors === errs_2;
                          }
                          if (valid2) {}
                        }
                        if (errs__1 == errors) {}
                      }
                    } else {
                      validate.errors = [{
                        keyword: 'type',
                        dataPath: (dataPath || '') + '.sensors',
                        schemaPath: '#/properties/sensors/type',
                        params: {
                          type: 'object'
                        },
                        message: 'should be object'
                      }];
                      return false;
                    }
                    if (errors === errs_1) {}
                    var valid1 = errors === errs_1;
                  }
                  if (valid1) {
                    var data1 = data.fields;
                    if (data1 === undefined) {
                      valid1 = true;
                    } else {
                      var errs_1 = errors;
                      if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                        if (true) {
                          var errs__1 = errors;
                          var valid2 = true;
                          if (data1._id === undefined) {
                            valid2 = false;
                            validate.errors = [{
                              keyword: 'required',
                              dataPath: (dataPath || '') + '.fields',
                              schemaPath: '#/properties/fields/required',
                              params: {
                                missingProperty: '_id'
                              },
                              message: 'should have required property \'_id\''
                            }];
                            return false;
                          } else {
                            var errs_2 = errors;
                            if (typeof data1._id !== "string") {
                              validate.errors = [{
                                keyword: 'type',
                                dataPath: (dataPath || '') + '.fields._id',
                                schemaPath: '#/properties/fields/properties/_id/type',
                                params: {
                                  type: 'string'
                                },
                                message: 'should be string'
                              }];
                              return false;
                            }
                            var valid2 = errors === errs_2;
                          }
                          if (valid2) {
                            var data2 = data1._rev;
                            if (data2 === undefined) {
                              valid2 = false;
                              validate.errors = [{
                                keyword: 'required',
                                dataPath: (dataPath || '') + '.fields',
                                schemaPath: '#/properties/fields/required',
                                params: {
                                  missingProperty: '_rev'
                                },
                                message: 'should have required property \'_rev\''
                              }];
                              return false;
                            } else {
                              var errs_2 = errors;
                              if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                                validate.errors = [{
                                  keyword: 'type',
                                  dataPath: (dataPath || '') + '.fields._rev',
                                  schemaPath: '#/properties/fields/properties/_rev/type',
                                  params: {
                                    type: 'integer'
                                  },
                                  message: 'should be integer'
                                }];
                                return false;
                              }
                              var valid2 = errors === errs_2;
                            }
                            if (valid2) {}
                          }
                          if (errs__1 == errors) {}
                        }
                      } else {
                        validate.errors = [{
                          keyword: 'type',
                          dataPath: (dataPath || '') + '.fields',
                          schemaPath: '#/properties/fields/type',
                          params: {
                            type: 'object'
                          },
                          message: 'should be object'
                        }];
                        return false;
                      }
                      if (errors === errs_1) {}
                      var valid1 = errors === errs_1;
                    }
                    if (valid1) {
                      var data1 = data.clients;
                      if (data1 === undefined) {
                        valid1 = true;
                      } else {
                        var errs_1 = errors;
                        if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                          if (true) {
                            var errs__1 = errors;
                            var valid2 = true;
                            if (data1._id === undefined) {
                              valid2 = false;
                              validate.errors = [{
                                keyword: 'required',
                                dataPath: (dataPath || '') + '.clients',
                                schemaPath: '#/properties/clients/required',
                                params: {
                                  missingProperty: '_id'
                                },
                                message: 'should have required property \'_id\''
                              }];
                              return false;
                            } else {
                              var errs_2 = errors;
                              if (typeof data1._id !== "string") {
                                validate.errors = [{
                                  keyword: 'type',
                                  dataPath: (dataPath || '') + '.clients._id',
                                  schemaPath: '#/properties/clients/properties/_id/type',
                                  params: {
                                    type: 'string'
                                  },
                                  message: 'should be string'
                                }];
                                return false;
                              }
                              var valid2 = errors === errs_2;
                            }
                            if (valid2) {
                              var data2 = data1._rev;
                              if (data2 === undefined) {
                                valid2 = false;
                                validate.errors = [{
                                  keyword: 'required',
                                  dataPath: (dataPath || '') + '.clients',
                                  schemaPath: '#/properties/clients/required',
                                  params: {
                                    missingProperty: '_rev'
                                  },
                                  message: 'should have required property \'_rev\''
                                }];
                                return false;
                              } else {
                                var errs_2 = errors;
                                if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                                  validate.errors = [{
                                    keyword: 'type',
                                    dataPath: (dataPath || '') + '.clients._rev',
                                    schemaPath: '#/properties/clients/properties/_rev/type',
                                    params: {
                                      type: 'integer'
                                    },
                                    message: 'should be integer'
                                  }];
                                  return false;
                                }
                                var valid2 = errors === errs_2;
                              }
                              if (valid2) {}
                            }
                            if (errs__1 == errors) {}
                          }
                        } else {
                          validate.errors = [{
                            keyword: 'type',
                            dataPath: (dataPath || '') + '.clients',
                            schemaPath: '#/properties/clients/type',
                            params: {
                              type: 'object'
                            },
                            message: 'should be object'
                          }];
                          return false;
                        }
                        if (errors === errs_1) {}
                        var valid1 = errors === errs_1;
                      }
                      if (valid1) {
                        var data1 = data['sensor-hubs'];
                        if (data1 === undefined) {
                          valid1 = true;
                        } else {
                          var errs_1 = errors;
                          if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                            if (true) {
                              var errs__1 = errors;
                              var valid2 = true;
                              if (data1._id === undefined) {
                                valid2 = false;
                                validate.errors = [{
                                  keyword: 'required',
                                  dataPath: (dataPath || '') + '[\'sensor-hubs\']',
                                  schemaPath: '#/properties/sensor-hubs/required',
                                  params: {
                                    missingProperty: '_id'
                                  },
                                  message: 'should have required property \'_id\''
                                }];
                                return false;
                              } else {
                                var errs_2 = errors;
                                if (typeof data1._id !== "string") {
                                  validate.errors = [{
                                    keyword: 'type',
                                    dataPath: (dataPath || '') + '[\'sensor-hubs\']._id',
                                    schemaPath: '#/properties/sensor-hubs/properties/_id/type',
                                    params: {
                                      type: 'string'
                                    },
                                    message: 'should be string'
                                  }];
                                  return false;
                                }
                                var valid2 = errors === errs_2;
                              }
                              if (valid2) {
                                var data2 = data1._rev;
                                if (data2 === undefined) {
                                  valid2 = false;
                                  validate.errors = [{
                                    keyword: 'required',
                                    dataPath: (dataPath || '') + '[\'sensor-hubs\']',
                                    schemaPath: '#/properties/sensor-hubs/required',
                                    params: {
                                      missingProperty: '_rev'
                                    },
                                    message: 'should have required property \'_rev\''
                                  }];
                                  return false;
                                } else {
                                  var errs_2 = errors;
                                  if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                                    validate.errors = [{
                                      keyword: 'type',
                                      dataPath: (dataPath || '') + '[\'sensor-hubs\']._rev',
                                      schemaPath: '#/properties/sensor-hubs/properties/_rev/type',
                                      params: {
                                        type: 'integer'
                                      },
                                      message: 'should be integer'
                                    }];
                                    return false;
                                  }
                                  var valid2 = errors === errs_2;
                                }
                                if (valid2) {}
                              }
                              if (errs__1 == errors) {}
                            }
                          } else {
                            validate.errors = [{
                              keyword: 'type',
                              dataPath: (dataPath || '') + '[\'sensor-hubs\']',
                              schemaPath: '#/properties/sensor-hubs/type',
                              params: {
                                type: 'object'
                              },
                              message: 'should be object'
                            }];
                            return false;
                          }
                          if (errors === errs_1) {}
                          var valid1 = errors === errs_1;
                        }
                        if (valid1) {
                          var data1 = data.isoblue;
                          if (data1 === undefined) {
                            valid1 = true;
                          } else {
                            var errs_1 = errors;
                            if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                              if (true) {
                                var errs__1 = errors;
                                var valid2 = true;
                                if (data1._id === undefined) {
                                  valid2 = false;
                                  validate.errors = [{
                                    keyword: 'required',
                                    dataPath: (dataPath || '') + '.isoblue',
                                    schemaPath: '#/properties/isoblue/required',
                                    params: {
                                      missingProperty: '_id'
                                    },
                                    message: 'should have required property \'_id\''
                                  }];
                                  return false;
                                } else {
                                  var errs_2 = errors;
                                  if (typeof data1._id !== "string") {
                                    validate.errors = [{
                                      keyword: 'type',
                                      dataPath: (dataPath || '') + '.isoblue._id',
                                      schemaPath: '#/properties/isoblue/properties/_id/type',
                                      params: {
                                        type: 'string'
                                      },
                                      message: 'should be string'
                                    }];
                                    return false;
                                  }
                                  var valid2 = errors === errs_2;
                                }
                                if (valid2) {}
                                if (errs__1 == errors) {}
                              }
                            } else {
                              validate.errors = [{
                                keyword: 'type',
                                dataPath: (dataPath || '') + '.isoblue',
                                schemaPath: '#/properties/isoblue/type',
                                params: {
                                  type: 'object'
                                },
                                message: 'should be object'
                              }];
                              return false;
                            }
                            if (errors === errs_1) {}
                            var valid1 = errors === errs_1;
                          }
                          if (valid1) {
                            if (data._id === undefined) {
                              valid1 = true;
                            } else {
                              var errs_1 = errors;
                              if (typeof data._id !== "string") {
                                validate.errors = [{
                                  keyword: 'type',
                                  dataPath: (dataPath || '') + '._id',
                                  schemaPath: '#/properties/_id/type',
                                  params: {
                                    type: 'string'
                                  },
                                  message: 'should be string'
                                }];
                                return false;
                              }
                              var valid1 = errors === errs_1;
                            }
                            if (valid1) {
                              var data1 = data._rev;
                              if (data1 === undefined) {
                                valid1 = true;
                              } else {
                                var errs_1 = errors;
                                if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
                                  validate.errors = [{
                                    keyword: 'type',
                                    dataPath: (dataPath || '') + '._rev',
                                    schemaPath: '#/properties/_rev/type',
                                    params: {
                                      type: 'integer'
                                    },
                                    message: 'should be integer'
                                  }];
                                  return false;
                                }
                                var valid1 = errors === errs_1;
                              }
                              if (valid1) {
                                var data1 = data._meta;
                                if (data1 === undefined) {
                                  valid1 = true;
                                } else {
                                  var errs_1 = errors;
                                  if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
                                    if (true) {
                                      var errs__1 = errors;
                                      var valid2 = true;
                                      if (data1._id === undefined) {
                                        valid2 = false;
                                        validate.errors = [{
                                          keyword: 'required',
                                          dataPath: (dataPath || '') + '._meta',
                                          schemaPath: '#/properties/_meta/required',
                                          params: {
                                            missingProperty: '_id'
                                          },
                                          message: 'should have required property \'_id\''
                                        }];
                                        return false;
                                      } else {
                                        var errs_2 = errors;
                                        if (typeof data1._id !== "string") {
                                          validate.errors = [{
                                            keyword: 'type',
                                            dataPath: (dataPath || '') + '._meta._id',
                                            schemaPath: '#/properties/_meta/properties/_id/type',
                                            params: {
                                              type: 'string'
                                            },
                                            message: 'should be string'
                                          }];
                                          return false;
                                        }
                                        var valid2 = errors === errs_2;
                                      }
                                      if (valid2) {
                                        var data2 = data1._rev;
                                        if (data2 === undefined) {
                                          valid2 = false;
                                          validate.errors = [{
                                            keyword: 'required',
                                            dataPath: (dataPath || '') + '._meta',
                                            schemaPath: '#/properties/_meta/required',
                                            params: {
                                              missingProperty: '_rev'
                                            },
                                            message: 'should have required property \'_rev\''
                                          }];
                                          return false;
                                        } else {
                                          var errs_2 = errors;
                                          if ((typeof data2 !== "number" || (data2 % 1) || data2 !== data2)) {
                                            validate.errors = [{
                                              keyword: 'type',
                                              dataPath: (dataPath || '') + '._meta._rev',
                                              schemaPath: '#/properties/_meta/properties/_rev/type',
                                              params: {
                                                type: 'integer'
                                              },
                                              message: 'should be integer'
                                            }];
                                            return false;
                                          }
                                          var valid2 = errors === errs_2;
                                        }
                                        if (valid2) {}
                                      }
                                      if (errs__1 == errors) {}
                                    }
                                  } else {
                                    validate.errors = [{
                                      keyword: 'type',
                                      dataPath: (dataPath || '') + '._meta',
                                      schemaPath: '#/properties/_meta/type',
                                      params: {
                                        type: 'object'
                                      },
                                      message: 'should be object'
                                    }];
                                    return false;
                                  }
                                  if (errors === errs_1) {}
                                  var valid1 = errors === errs_1;
                                }
                                if (valid1) {
                                  if (data._type === undefined) {
                                    valid1 = false;
                                    validate.errors = [{
                                      keyword: 'required',
                                      dataPath: (dataPath || '') + "",
                                      schemaPath: '#/required',
                                      params: {
                                        missingProperty: '_type'
                                      },
                                      message: 'should have required property \'_type\''
                                    }];
                                    return false;
                                  } else {
                                    var errs_1 = errors;
                                    var schema1 = validate.schema.properties._type.enum;
                                    var valid1;
                                    valid1 = false;
                                    for (var i1 = 0; i1 < schema1.length; i1++)
                                      if (equal(data._type, schema1[i1])) {
                                        valid1 = true;
                                        break;
                                      } if (!valid1) {
                                      validate.errors = [{
                                        keyword: 'enum',
                                        dataPath: (dataPath || '') + '._type',
                                        schemaPath: '#/properties/_type/enum',
                                        params: {
                                          allowedValues: schema1
                                        },
                                        message: 'should be equal to one of the allowed values'
                                      }];
                                      return false;
                                    } else {}
                                    if (errors === errs_1) {}
                                    var valid1 = errors === errs_1;
                                  }
                                  if (valid1) {}
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        if (errs__0 == errors) {}
      }
    } else {
      validate.errors = [{
        keyword: 'type',
        dataPath: (dataPath || '') + "",
        schemaPath: '#/type',
        params: {
          type: 'object'
        },
        message: 'should be object'
      }];
      return false;
    }
    if (errors === 0) {}
    validate.errors = vErrors;
    return errors === 0;
  };
})();
validate.schema = {
  "$id": "https://formats.openag.io/oada/bookmarks/v1.schema.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "bookmarks is the top-level document returned by the OADA API",
  "properties": {
    "trellisfw": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "planting": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "harvest": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "machines": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "irrigation": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "sensors": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "fields": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "clients": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "sensor-hubs": {
      "description": "A versioned link in OADA has _id an _rev in the link in order allow changes to bubble up from child to parents.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "isoblue": {
      "description": "A link in OADA has at least an _id key and links one resource to another.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        }
      },
      "required": ["_id"],
      "type": "object"
    },
    "_id": {
      "description": "_id identifies a resource in the OADA API.",
      "type": "string"
    },
    "_rev": {
      "description": "_rev is the revision string for a resource in the OADA API.",
      "type": "integer"
    },
    "_meta": {
      "description": "_meta is a link to the meta document for a resources.",
      "properties": {
        "_id": {
          "description": "_id identifies a resource in the OADA API.",
          "type": "string"
        },
        "_rev": {
          "description": "_rev is the revision string for a resource in the OADA API.",
          "type": "integer"
        }
      },
      "required": ["_id", "_rev"],
      "type": "object"
    },
    "_type": {
      "enum": ["application/vnd.oada.bookmarks.1+json"]
    }
  },
  "additionalProperties": true,
  "required": ["_type"],
  "type": "object",
  "examples": [{
    "_type": "application/vnd.oada.bookmarks.1+json",
    "context": {},
    "planting": {
      "_id": "resources/09ijfofj",
      "_rev": 2
    },
    "harvest": {
      "_id": "resources/908uf2jh",
      "_rev": 33
    },
    "machines": {
      "_id": "respurces/0kdfj20j",
      "_rev": 8
    },
    "irrigation": {
      "_id": "resources/0jk2iopw",
      "_rev": 4
    },
    "sales": {
      "_id": "resources/0kdfj20j",
      "_rev": 99
    },
    "sensors": {
      "_id": "resources/kd02ufjk",
      "_rev": 3
    },
    "fields": {
      "_id": "resources/0kdfj2jl",
      "_rev": 7
    },
    "clients": {
      "_id": "resources/9sdkf2lk",
      "_rev": 4
    },
    "sensor-hubs": {
      "_id": "resources/xks84x8s",
      "_rev": 1
    }
  }]
};
validate.errors = null;
module.exports = validate;