lib/validators/spec.js
function validateBodyParameters (params, operationId) {
  var bodyParams = params.filter(function (param) { return param.in === "body"; });
  var formParams = params.filter(function (param) { return param.in === "formData"; });

  // There can only be one "body" parameter
  if (bodyParams.length > 1) {
    throw ono.syntax(
      "Validation failed. %s has %d body parameters. Only one is allowed.",
      operationId, bodyParams.length
    );
  }
  else if (bodyParams.length > 0 && formParams.length > 0) {
    // "body" params and "formData" params are mutually exclusive
    throw ono.syntax(
      "Validation failed. %s has body parameters and formData parameters. Only one or the other is allowed.",
      operationId
    );
  }
}
function validateBodyParameters (params, operationId) {
  var bodyParams = params.filter(function (param) { return param.in === "body"; });
  var formParams = params.filter(function (param) { return param.in === "formData"; });

  // There can only be one "body" parameter
  if (bodyParams.length > 1) {
    throw ono.syntax(
      "Validation failed. %s has %d body parameters. Only one is allowed.",
      operationId, bodyParams.length
    );
  }
  else if (bodyParams.length > 0 && formParams.length > 0) {
    // "body" params and "formData" params are mutually exclusive
    throw ono.syntax(
      "Validation failed. %s has body parameters and formData parameters. Only one or the other is allowed.",
      operationId
    );
  }
}
function validateBodyParameters ( params , operationId ) { var bodyParams = params . filter ( function ( param ) { return param . in === "body" ; } ) ; var formParams = params . filter ( function ( param ) { return param . in === "formData" ; } ) ; // There can only be one "body" parameter if ( bodyParams . length > 1 ) { throw ono . syntax ( "Validation failed. %s has %d body parameters. Only one is allowed." , operationId , bodyParams . length ) ; } else if ( bodyParams . length > 0 && formParams . length > 0 ) { // "body" params and "formData" params are mutually exclusive throw ono . syntax ( "Validation failed. %s has body parameters and formData parameters. Only one or the other is allowed." , operationId ) ; } }
Validates body and formData parameters for the given operation.

@param   {object[]}  params       -  An array of Parameter objects
@param   {string}    operationId  -  A value that uniquely identifies the operation
Validates body and formData parameters for the given operation .