Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for i, v in enumerate(input):
sub_path = path + "[*]"
rules.update(get_matching_rules_v2(v, sub_path))
return rules
if isinstance(input, LIKE_CLASSES):
rules = {path: {"match": "type"}}
rules.update(get_matching_rules_v2(input.matcher, path))
return rules
if isinstance(input, EACHLIKE_CLASSES):
rules = {path: {"match": "type", "min": input.minimum}}
rules.update(get_matching_rules_v2(input.matcher, path))
return rules
if isinstance(input, TERM_CLASSES):
return {path: {"regex": input.matcher}}
if isinstance(input, Equals):
raise Equals.NotAllowed(f"Equals() cannot be used in pact version 2")
if isinstance(input, Includes):
raise Includes.NotAllowed(f"Includes() cannot be used in pact version 2")
raise ValueError("Unknown type: %s" % type(input))
rules = {}
for i, v in enumerate(input):
sub_path = path + "[*]"
rules.update(get_matching_rules_v2(v, sub_path))
return rules
if isinstance(input, LIKE_CLASSES):
rules = {path: {"match": "type"}}
rules.update(get_matching_rules_v2(input.matcher, path))
return rules
if isinstance(input, EACHLIKE_CLASSES):
rules = {path: {"match": "type", "min": input.minimum}}
rules.update(get_matching_rules_v2(input.matcher, path))
return rules
if isinstance(input, TERM_CLASSES):
return {path: {"regex": input.matcher}}
if isinstance(input, Equals):
raise Equals.NotAllowed(f"Equals() cannot be used in pact version 2")
if isinstance(input, Includes):
raise Includes.NotAllowed(f"Includes() cannot be used in pact version 2")
raise ValueError("Unknown type: %s" % type(input))