code: function makeBodyParser(spec) {
    if (!(spec.validate && spec.validate.type)) return noopMiddleware;
  
    switch (spec.validate.type) {
      case 'json':
        return wrapError(spec, makeJSONBodyParser(spec));
      case 'form':
        return wrapError(spec, makeFormBodyParser(spec));
      case 'stream':
      case 'multipart':
        return wrapError(spec, makeMultipartParser(spec));
      default:
        throw new Error(`unsupported body type: ${spec.validate.type}`);
    }
  }
docs: Creates body parser middleware.
  
  @param {Object} spec
  @return {async function}
  @api private