lib/validators/spec.js
function validateSchema (schema, schemaId, validTypes) {
  if (validTypes.indexOf(schema.type) === -1) {
    throw ono.syntax(
      "Validation failed. %s has an invalid type (%s)", schemaId, schema.type);
  }

  if (schema.type === "array" && !schema.items) {
    throw ono.syntax('Validation failed. %s is an array, so it must include an "items" schema', schemaId);
  }
}
function validateSchema (schema, schemaId, validTypes) {
  if (validTypes.indexOf(schema.type) === -1) {
    throw ono.syntax(
      "Validation failed. %s has an invalid type (%s)", schemaId, schema.type);
  }

  if (schema.type === "array" && !schema.items) {
    throw ono.syntax('Validation failed. %s is an array, so it must include an "items" schema', schemaId);
  }
}
function validateSchema ( schema , schemaId , validTypes ) { if ( validTypes . indexOf ( schema . type ) === - 1 ) { throw ono . syntax ( "Validation failed. %s has an invalid type (%s)" , schemaId , schema . type ) ; } if ( schema . type === "array" && ! schema . items ) { throw ono . syntax ( 'Validation failed. %s is an array, so it must include an "items" schema' , schemaId ) ; } }
Validates the given Swagger schema object.

@param {object}    schema      - A Schema object, from the Swagger API
@param {string}    schemaId    - A value that uniquely identifies the schema object
@param {string[]}  validTypes  - An array of the allowed schema types
Validates the given Swagger schema object .