src/validator/model.js
function _validateArray (path, model, validateModelType) {
  const results = []
  let subPath = `${path}/items`
  if (_.isPlainObject(model.items)) {
    if (model.items.type === 'object') {
      results.push(validateSubModel(subPath, model.items, validateModelType))
    }
  } else if (Array.isArray(model.items)) {
    _.forEach(model.items, (item, index) => {
      const itemSubPath = `${subPath}/${index}`
      results.push(validateSubModel(itemSubPath, item, validateModelType))
    })
  }

  return aggregateResults(results)
}
function _validateArray (path, model, validateModelType) {
  const results = []
  let subPath = `${path}/items`
  if (_.isPlainObject(model.items)) {
    if (model.items.type === 'object') {
      results.push(validateSubModel(subPath, model.items, validateModelType))
    }
  } else if (Array.isArray(model.items)) {
    _.forEach(model.items, (item, index) => {
      const itemSubPath = `${subPath}/${index}`
      results.push(validateSubModel(itemSubPath, item, validateModelType))
    })
  }

  return aggregateResults(results)
}
function _validateArray ( path , model , validateModelType ) { const results = [ ] let subPath = ` ${ path } ` if ( _ . isPlainObject ( model . items ) ) { if ( model . items . type === 'object' ) { results . push ( validateSubModel ( subPath , model . items , validateModelType ) ) } } else if ( Array . isArray ( model . items ) ) { _ . forEach ( model . items , ( item , index ) => { const itemSubPath = ` ${ subPath } ${ index } ` results . push ( validateSubModel ( itemSubPath , item , validateModelType ) ) } ) } return aggregateResults ( results ) }
Validate the array definition
@param {String} path - the path to the field from the root of the model
@param {BunsenModel} model - the model to validate
@param {Function} validateModelType - function to validate model type
@returns {BunsenValidationResult} the results of the model validation
Validate the array definition