def _strip_additional_query_parameters(schema, req):
 additional_properties = schema.get('addtionalProperties', True)
 pattern_regexes = []
 patterns = schema.get('patternProperties', None)
 if patterns:
  for regex in patterns:
   pattern_regexes.append(re.compile(regex))
 if additional_properties:
  for param in set(req.GET.keys()):
   if (param not in schema['properties'].keys()):
    if (not list((regex for regex in pattern_regexes if regex.match(param)))):
     del req.GET[param]

def _strip_additional_query_parameters ( schema , req ) : additional_properties = schema . get ( 'addtionalProperties' , True ) pattern_regexes = [ ] patterns = schema . get ( 'patternProperties' , None ) if patterns : for regex in patterns : pattern_regexes . append ( re . compile ( regex ) ) if additional_properties : for param in set ( req . GET . keys ( ) ) : if ( param not in schema [ 'properties' ] . keys ( ) ) : if ( not list ( ( regex for regex in pattern_regexes if regex . match ( param ) ) ) ) : del req . GET [ param ]
strip the additional properties from the req .