def _schema_validation_helper(schema, target, min_version, max_version, args, kwargs, is_body=True):
 min_ver = api_version.APIVersionRequest(min_version)
 max_ver = api_version.APIVersionRequest(max_version)
 if ('req' in kwargs):
  ver = kwargs['req'].api_version_request
  legacy_v2 = kwargs['req'].is_legacy_v2()
 else:
  ver = args[1].api_version_request
  legacy_v2 = args[1].is_legacy_v2()
 if legacy_v2:
  if ((min_version is None) or (min_version == '2.0')):
   schema_validator = validators._SchemaValidator(schema, legacy_v2, is_body)
   schema_validator.validate(target)
   return True
 elif ver.matches(min_ver, max_ver):
  schema_validator = validators._SchemaValidator(schema, legacy_v2, is_body)
  schema_validator.validate(target)
  return True
 return False

def _schema_validation_helper ( schema , target , min_version , max_version , args , kwargs , is_body = True ) : min_ver = api_version . APIVersionRequest ( min_version ) max_ver = api_version . APIVersionRequest ( max_version ) if ( 'req' in kwargs ) : ver = kwargs [ 'req' ] . api_version_request legacy_v2 = kwargs [ 'req' ] . is_legacy_v2 ( ) else : ver = args [ 1 ] . api_version_request legacy_v2 = args [ 1 ] . is_legacy_v2 ( ) if legacy_v2 : if ( ( min_version is None ) or ( min_version == '2.0' ) ) : schema_validator = validators . _SchemaValidator ( schema , legacy_v2 , is_body ) schema_validator . validate ( target ) return True elif ver . matches ( min_ver , max_ver ) : schema_validator = validators . _SchemaValidator ( schema , legacy_v2 , is_body ) schema_validator . validate ( target ) return True return False
a helper method to execute json-schema validation .