src/validator/index.js
function _validateRootAttributes (view, model, cellValidator) {
  const results = [
    _validateCells(view, model, cellValidator)
  ]

  const knownAttributes = ['version', 'type', 'cells', 'cellDefinitions']
  const unknownAttributes = _.difference(Object.keys(view), knownAttributes)
  results.push({
    errors: [],
    warnings: _.map(unknownAttributes, (attr) => {
      return {
        path: '#',
        message: `Unrecognized attribute "${attr}"`
      }
    })
  })

  return aggregateResults(results)
}
function _validateRootAttributes (view, model, cellValidator) {
  const results = [
    _validateCells(view, model, cellValidator)
  ]

  const knownAttributes = ['version', 'type', 'cells', 'cellDefinitions']
  const unknownAttributes = _.difference(Object.keys(view), knownAttributes)
  results.push({
    errors: [],
    warnings: _.map(unknownAttributes, (attr) => {
      return {
        path: '#',
        message: `Unrecognized attribute "${attr}"`
      }
    })
  })

  return aggregateResults(results)
}
function _validateRootAttributes ( view , model , cellValidator ) { const results = [ _validateCells ( view , model , cellValidator ) ] const knownAttributes = [ 'version' , 'type' , 'cells' , 'cellDefinitions' ] const unknownAttributes = _ . difference ( Object . keys ( view ) , knownAttributes ) results . push ( { errors : [ ] , warnings : _ . map ( unknownAttributes , ( attr ) => { return { path : '#' , message : ` ${ attr } ` } } ) } ) return aggregateResults ( results ) }
Validate the root attributes of the view
@param {BunsenView} view - the view to validate
@param {BunsenModel} model - the JSON schema that the cells will reference
@param {CellValidator} cellValidator - the validator instance for a cell in the current view
@returns {BunsenValidationResult} any errors found
Validate the root attributes of the view