function buildMembersArraySchema({ userType, tierRequired }) {
  const keys = {
    MemberId: Joi.number().required(),
    type: userType || Joi.string().required(),
    role: Joi.string().required(),
  }
  if (tierRequired) keys.tier = Joi.string().required()
  return Joi.array().items(Joi.object().keys(keys))
}
function buildMembersArraySchema({ userType, tierRequired }) {
  const keys = {
    MemberId: Joi.number().required(),
    type: userType || Joi.string().required(),
    role: Joi.string().required(),
  }
  if (tierRequired) keys.tier = Joi.string().required()
  return Joi.array().items(Joi.object().keys(keys))
}
function buildMembersArraySchema ( { userType , tierRequired } ) { const keys = { MemberId : Joi . number ( ) . required ( ) , type : userType || Joi . string ( ) . required ( ) , role : Joi . string ( ) . required ( ) , } if ( tierRequired ) keys . tier = Joi . string ( ) . required ( ) return Joi . array ( ) . items ( Joi . object ( ) . keys ( keys ) ) }
https://developer.opencollective.com/#/api/collectives?id=get-members
https : // developer . opencollective . com / # / api / collectives?id = get - members
Build a schema for the members array