const onProxyEndpoint = function()

in tools/pipeline-linter/apigeelint/EX-001-BasepathConventions.js [24:45]


const onProxyEndpoint = function (ep, cb) {
  let httpProxyConnection = ep.getHTTPProxyConnection(),
    hadError = false;

  if (httpProxyConnection) {
    //console.log("basepath:" + httpProxyConnection.getBasePath());
    let basepath = httpProxyConnection.getBasePath();
    if (basepath && !basepath.startsWith(basepathConvention)) {
      ep.addMessage({
        plugin,
        source: httpProxyConnection.getSource(),
        line: httpProxyConnection.getElement().lineNumber,
        column: httpProxyConnection.getElement().columnNumber,
        message: `Basepath not following "${basepathConvention}" convention`
      });
      hadError = true;
    }
  }
  if (typeof (cb) == 'function') {
    cb(null, hadError);
  }
};