Checks that all routes are validate and have corresponding lambda functions
11951
def check_route_connected_functions
      return if Jets::Router.all_routes_valid

      puts "Deploy fail: The jets application contain invalid routes.".color(:red)
      puts "Please double check the routes below map to valid controllers:"
      Jets::Router.invalid_routes.each do |route|
        puts "  /#{route.path} => #{route.controller_name}##{route.action_name}"
      end
      exit 1
    end
1178073
def validate(cls, event_info):
        """"""
        assert 'routing_key' in event_info
        assert isinstance(event_info['routing_key'], six.string_types)
        assert 'event_action' in event_info
        assert event_info['event_action'] in cls.EVENT_TYPES
        assert 'payload' in event_info
        payload = event_info['payload']
        assert payload['summary']
        assert payload['source']
        assert payload['severity'] in cls.SEVERITY_TYPES
782752
function callbacks(err) {
      var fn = route.callbacks[i++];
      try {
        if ('route' == err) {
          nextRoute();
        } else if (err && fn) {
          if (fn.length < 4) return callbacks(err);
          fn(err, req, res, callbacks);
        } else if (fn) {
          if (fn.length < 4) return fn(req, res, callbacks);
          callbacks();
        } else {
          nextRoute(err);
        }
      } catch (err) {
        callbacks(err);
      }
    }
1192745
function(routeName, models, queryParams) {
        var router = this.router;
        return router.isActive.apply(router, arguments);
      }
659263
function validateFunction(path, driver, functionName) {
  if (typeof driver[functionName] !== 'function') {
    console.error(`${path} missing .${functionName}() implementation`);
    process.exit(1);
  }
}
477784
def validate(self, input_parameters, context):
        """"""
        errors = {}

        for key, type_handler in self.input_transformations.items():
            if self.raise_on_invalid:
                if key in input_parameters:
                    input_parameters[key] = self.initialize_handler(
                        type_handler,
                        input_parameters[key],
                        context=context
                    )
            else:
                try:
                    if key in input_parameters:
                        input_parameters[key] = self.initialize_handler(
                            type_handler,
                            input_parameters[key],
                            context=context
                        )
                except InvalidTypeData as error:
                    errors[key] = error.reasons or str(error.message)
                except Exception as error:
                    if hasattr(error, 'args') and error.args:
                        errors[key] = error.args[0]
                    else:
                        errors[key] = str(error)
        for require in self.required:
            if not require in input_parameters:
                errors[require] = "Required parameter '{}' not supplied".format(require)
        if not errors and getattr(self, 'validate_function', False):
            errors = self.validate_function(input_parameters)
        return errors
14141
function registerPathParamMiddleware () {
    let pathParams = getAllPathParamNames();

    pathParams.forEach((param) => {
      if (!alreadyRegistered(param)) {
        router.param(param, pathParamMiddleware);
      }
    });
  }
1084383
protected function validate_lib_workers() {

        foreach ($this->functions as $func => $props) {
            require_once $props["path"];
            $real_func = $this->prefix.$func;
            if (!function_exists($real_func) &&
               (!class_exists($real_func) || !method_exists($real_func, "run"))) {
                $this->log("Function $real_func not found in ".$props["path"]);
                posix_kill($this->pid, SIGUSR2);
                exit();
            }
        }

    }
870568
def passes_route_hooks?(route, message, robot)
      robot.hooks[:validate_route].all? do |hook|
        hook.call(handler: handler, route: route, message: message, robot: robot)
      end
    end
113723
function(server, model, options, logger) {
      // This line must come first
      validationHelper.validateModel(model, logger)
      const Log = logger.bind(chalk.yellow('List'))

      let collectionName = model.collectionDisplayName || model.modelName
      options = options || {}

      if (config.logRoutes) {
        Log.note('Generating List endpoint for ' + collectionName)
      }

      let resourceAliasForRoute

      if (model.routeOptions) {
        resourceAliasForRoute = model.routeOptions.alias || model.modelName
      } else {
        resourceAliasForRoute = model.modelName
      }

      let handler = HandlerHelper.generateListHandler(model, options, Log)

      let queryModel = joiMongooseHelper.generateJoiListQueryModel(model, Log)

      let readModel = joiMongooseHelper.generateJoiReadModel(model, Log)

      if (!config.enableResponseValidation) {
        let label = readModel._flags.label
        readModel = Joi.alternatives()
          .try(readModel, Joi.any())
          .label(label)
      }

      let auth = false
      let listHeadersValidation = Object.assign(headersValidation, {})

      if (config.authStrategy && model.routeOptions.readAuth !== false) {
        auth = {
          strategy: config.authStrategy
        }

        let scope = authHelper.generateScopeForEndpoint(model, 'read', Log)

        if (!_.isEmpty(scope)) {
          auth.scope = scope
          if (config.logScopes) {
            Log.debug('Scope for GET/' + resourceAliasForRoute + ':', scope)
          }
        }
      } else {
        listHeadersValidation = null
      }

      let policies = []

      if (model.routeOptions.policies && config.enablePolicies) {
        policies = model.routeOptions.policies
        policies = (policies.rootPolicies || []).concat(
          policies.readPolicies || []
        )
      }

      if (config.enableDocumentScopes && auth) {
        policies.push(restHapiPolicies.enforceDocumentScopePre(model, Log))
        policies.push(restHapiPolicies.enforceDocumentScopePost(model, Log))
      }

      server.route({
        method: 'GET',
        path: '/' + resourceAliasForRoute,
        config: {
          handler: handler,
          auth: auth,
          description: 'Get a list of ' + collectionName + 's',
          tags: ['api', collectionName],
          cors: config.cors,
          validate: {
            query: queryModel,
            headers: listHeadersValidation
          },
          plugins: {
            model: model,
            'hapi-swagger': {
              responseMessages: [
                {
                  code: 200,
                  message: 'The resource(s) was/were found successfully.'
                },
                { code: 400, message: 'The request was malformed.' },
                {
                  code: 401,
                  message:
                    'The authentication header was missing/malformed, or the token has expired.'
                },
                { code: 500, message: 'There was an unknown error.' },
                {
                  code: 503,
                  message: 'There was a problem with the database.'
                }
              ]
            },
            policies: policies
          },
          response: {
            failAction: config.enableResponseFail ? 'error' : 'log',
            schema: Joi.alternatives()
              .try(
                Joi.object({
                  docs: Joi.array()
                    .items(readModel)
                    .label(collectionName + 'ArrayModel'),
                  pages: Joi.any(),
                  items: Joi.any()
                }),
                Joi.number()
              )
              .label(collectionName + 'ListModel')
          }
        }
      })
    }
1032040
public boolean anyMatched(String[] requestPathTokens) {
		Map<String, String> pathParams = new HashMap<>();
		for (PathPattern pattern : routes.keySet()) {
			if (pattern.match(requestPathTokens, pathParams)) {
				return true;
			}

			// Reset for the next loop
			pathParams.clear();
		}

		return false;
	}
483237
function removeRoutes(app) {
  return function (api, done) {
    if (!api) {
      done(null, false); // no routes to remove
      return
    }

    var removedRoutes = _.remove(app._router.stack, function (layer) {
      if (layer.route == undefined) {
        return false;
      } else {
        return api.matchesRoute(layer.route.path, layer.route.methods);
      }
    });

    if (removedRoutes && removedRoutes.length > 0) {
      console.log(`removed ${removedRoutes.length} routes`);
    }

    done(null, api);
  }
}
631218
def validate(config):
    '''
    
    '''
    if not isinstance(config, list):
        return False, ('Configuration for haproxy beacon must '
                       'be a list.')
    else:
        _config = {}
        list(map(_config.update, config))

        if 'backends' not in _config:
            return False, ('Configuration for haproxy beacon '
                           'requires backends.')
        else:
            if not isinstance(_config['backends'], dict):
                return False, ('Backends for haproxy beacon '
                               'must be a dictionary.')
            else:
                for backend in _config['backends']:
                    log.debug('_config %s', _config['backends'][backend])
                    if 'servers' not in _config['backends'][backend]:
                        return False, ('Backends for haproxy beacon '
                                       'require servers.')
                    else:
                        _servers = _config['backends'][backend]['servers']
                        if not isinstance(_servers, list):
                            return False, ('Servers for haproxy beacon '
                                           'must be a list.')
    return True, 'Valid beacon configuration'
8585
function on (route, methods) {
    assert.equal(typeof route, 'string')
    methods = methods || {}

    // mount subrouter
    if (methods[sym]) return router.on(route, methods)

    assert.equal(typeof methods, 'object')

    // mount http methods
    router.on(route, function (args) {
      demuxSsa(args, function (req, res, params) {
        const meth = methodist(req, defaultFn, methods)
        meth(req, res, params)

        // default function to call if methods don't match
        // null -> null
        function defaultFn () {
          router._default(args)
        }
      })
    })
    return emit
  }
394913
def validateAllServers(self):
        
        url = self._url + "/servers/validate"
        params = {"f" : "json"}
        return self._get(url=url,
                         param_dict=params,
                         proxy_port=self._proxy_port,
                         proxy_url=self._proxy_ur)
737892
protected function validateMethod()
    {
        if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) {
            throw new MethodNotAllowedException($methods);
        }
    }
357114
def bind(cls, app, *paths, methods=None, name=None, router=None, view=None):
        """"""
        cls.app = app
        if cls.app is not None:
            for _, m in inspect.getmembers(cls, predicate=inspect.isfunction):
                if not hasattr(m, ROUTE_PARAMS_ATTR):
                    continue
                paths_, methods_, name_ = getattr(m, ROUTE_PARAMS_ATTR)
                name_ = name_ or ("%s.%s" % (cls.name, m.__name__))
                delattr(m, ROUTE_PARAMS_ATTR)
                cls.app.register(*paths_, methods=methods_, name=name_, handler=cls)(m)

        @coroutine
        @functools.wraps(cls)
        def handler(request):
            return cls().dispatch(request, view=view)

        if not paths:
            paths = ["/%s" % cls.__name__]

        return routes_register(
            app, handler, *paths, methods=methods, router=router, name=name or cls.name)